```
def findKthElement(arr, n, k):
i=0
heap=[]
heapq.heapify(heap)
while i<len(arr):
num=arr[i]
curr=0
while num!=1:
curr+=1
if num%2==0:
num//=2
else:
num=(num*3)+1
heapq.heappush(heap,[-curr,-arr[i]])
if len(heap)>k:
heapq.heappop(heap)
i+=1
ans=heapq.heappop(heap)
return -1*ans[1]
```

Read the question properly.You have to make the number== 1 and count its oprationsâ€¦Please do upvote