TOP K FREQUENT WORDS| LEETCODE 692 | PYTHON CUSTOM HEAP SOLUTION
Vložit
- čas přidán 24. 07. 2024
- Channel Discord Community: / discord
Problem Link: leetcode.com/problems/top-k-f...
Today we are solving a very cool question that involves an approach that we actually rarely see on Leetcode. We'll be writing some custom class which will allow us to compare multiple properties at once when using a Min-Heap 🤯
TIMESTAMPS
00:00 Intro
00:07 Question Prompt
00:24Basic Example
01:32 Solution Intuition
3:19 Coding
11:40 Time/Space Complexity
12:40 Outro - Věda a technologie
so beautiful solution!! thank you for explaining
Can you explain why in your __lt__ the comparison is self.word > to_compare.word? My assumption is that if you're trying to compare if the current word is lexicographically smaller than the "to_compare" word then it would be self.word < to_compare.word?
you channel is very underrated
I agree haha