MAJORITY ELEMENT | LEETCODE 169 | PYTHON SOLUTION

Sdílet
Vložit
  • čas přidán 24. 07. 2024
  • Channel Discord Community: / discord
    Problem Link: leetcode.com/problems/majorit...
    In this video we are solving another question for some of the beginners to the Leetcode journey: Majority Element (#169). Pretty straightforward question but there's a catch that we want to solve it without using any extra space.
    TIMESTAMPS
    00:00 Intro
    00:10 Question Prompt
    00:25 Basic Examples
    00:50 Solution Intuition
    05:26 Coding
    06:50 Time/Space Complexity
    07:40 Outro
  • Věda a technologie

Komentáře • 5

  • @YT.Nikolay
    @YT.Nikolay Před 6 měsíci

    To the viewer, this one is killer, totally worth your time!

  • @alexandrep4913
    @alexandrep4913 Před 5 měsíci

    Oh dang, that's cool. I was just using a heap that inputs pairs and sorts based on the count.

    • @zkkzkk32312
      @zkkzkk32312 Před 3 měsíci

      That would not be O(1) of space complexity.

  • @AnandKumar-kz3ls
    @AnandKumar-kz3ls Před 5 měsíci

    please make video on MAJORITY ELEMENT 2 will be really appericated

  • @zkkzkk32312
    @zkkzkk32312 Před 3 měsíci

    The Space O(1) should have made this non easy...