MAJORITY ELEMENT | LEETCODE 169 | PYTHON SOLUTION
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
To the viewer, this one is killer, totally worth your time!
Oh dang, that's cool. I was just using a heap that inputs pairs and sorts based on the count.
That would not be O(1) of space complexity.
please make video on MAJORITY ELEMENT 2 will be really appericated
The Space O(1) should have made this non easy...