Find the Kth Largest Integer in the Array - Leetcode Weekly Contest - 1985 Python

preview_player
Показать описание


0:00 - Read the problem
0:50 - Drawing Explanation
2:45 - Coding Explanation

leetcode 1985

#sorted #array #python
Disclosure: Some of the links above may be affiliate links, from which I may earn a small commission.
Рекомендации по теме
Комментарии
Автор

Cant we just use a k-sized min_heap so that we can get NLog(k) time complexity?

jkim
Автор

Can we generally ignore the time complexity for converting string to an integer ?

kaushikrishi
Автор

Only explanation from neet code that was not immersive. Probably will look up heapify on my own and will come back here

jayanthk
Автор

3:22 is fine either way, even if original array have negative values

centuryschizoid
Автор

i think this only works in python because it's the only language where it won't overflow, we should compare the strings the way they are without casting to int

mohamedsalama
Автор

Everybody is saying to use a Min Heap with Kth Largest and a Max Heap with Kth Smallest yet your usage of Max heap for this seems more intuitive.

rydmerlin
Автор

Can you make videos on query based questions

rishabsharma
Автор

Bhi plz let me know where I can find the solution of leetcode problem

abhishekupadhyay
Автор

cant we just convert it into a integer ArrayList n sort n return the kth element!!...the problem that I faced is the value is too large(i used JAVA)....any advice!

vishalr
Автор

I found a bug.

The Problem Link is wrong :-)

srinadhp
Автор

3 line solution with O(nlog(n))

val = [ int(x) for x in nums ]
val.sort(reverse=True)
return str(val[k-1])

jideabdqudus
Автор

why don't you do the hard problem?

sauravmandal