TOP K FREQUENT WORDS| LEETCODE 692 | PYTHON CUSTOM HEAP SOLUTION

Sdílet
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

Komentáře • 4

  • @kamila5207
    @kamila5207 Před měsícem

    so beautiful solution!! thank you for explaining

  • @seant11
    @seant11 Před 5 dny

    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?

  • @satwiktatikonda764
    @satwiktatikonda764 Před 4 měsíci +2

    you channel is very underrated