I liked the discussion, particularly the negative height and which you took it as an advantage in the priority queue.
@TheTechGranth3 жыл бұрын
Thanks a lot. Hope the video helped you. Do like and subscribe and share it with others. BTW the same concept can help in solving meeting room problems as well.
@namahshivaya98742 жыл бұрын
Wow. I struggled to understand this, and your explanation was simply the best of all of them. Thank you!
@muraliKrishnaanimi3 жыл бұрын
isn't pq.remove() is costly? In c++ priorty_queue from stl has no option for remove(). any ideas to optimize?
@TheTechGranth3 жыл бұрын
Time complexity of remove is O(logn) some way to handle in C++ stackoverflow.com/questions/19467485/how-to-remove-element-not-at-top-from-priority-queue
@obulpathi2729 Жыл бұрын
Excellent m..you nailed it, thanks for explaining!!
@ameynaik27433 жыл бұрын
Nice solution, what is the approach to remove a specific element from pq in python? Looks like I need to use sortedList instead of heapq?
@TheTechGranth3 жыл бұрын
Can you check if this works stackoverflow.com/questions/10162679/python-delete-element-from-heap
@madmax24423 жыл бұрын
Great explanation and walkthrough! Glad that I found you channel :)
@TheTechGranth3 жыл бұрын
Thank you, hope it was helpful. Do share with others as well and do not forget to like and subscribe :) Do let me know in case you need video explanation for some other problem or system design
@madmax24423 жыл бұрын
@@TheTechGranth yeah sure!
@madmax24423 жыл бұрын
@@TheTechGranth Please make an explanation video for the problem: leetcode.com/problems/maximize-grid-happiness/
@TheTechGranth3 жыл бұрын
@@madmax2442 sure will try to come up with this ASAP
@harpercfc_2 жыл бұрын
Phenomenal explanation. Thank you dude 🥰
@roliverma44833 жыл бұрын
Very well explained
@TheTechGranth3 жыл бұрын
Thank you!!! Do check out the other videos of leetcode solution, system designs and microservices!!!
@roliverma44833 жыл бұрын
@@TheTechGranth Definitely
@abhinavyel1663 жыл бұрын
Nicely explained
@TheTechGranth3 жыл бұрын
Thank you :) !!! Do hit that like button and share it with your friends and Subscribe :)
@rathan235 Жыл бұрын
Great job
@sudhanshumishra9353 жыл бұрын
Hehe coding
@himanshuchhikara49183 жыл бұрын
Nicely explained
@TheTechGranth3 жыл бұрын
Thanks Himanshu. Hope you liked it, do check out the other videos and playlist. Kindly like subscribe and share it with your friends :)