Majority Element II | Leet code 229 | Theory explained + Python code

preview_player
Показать описание
This video is a solution to Leet code 229, Majority Element II. I explain the question and the best way to solve it and then solve it using Python.

Comment below if you have a better solution to this problem!

Let me know if you have any feedback and don't forget to subscribe for more videos!

Resources:

More leetcode questions solved:

Timestamps:
0:00 Question Explained
0:50 Boyer-Moore Vote Algorithm Explained
8:08 Solution Explained
14:09 Python Code

Gear used:
Рекомендации по теме
Комментарии
Автор

Nice. I always refer to your videos as my last resort because your tutorials are the most noob friendly. Keep it up!

ihsannuruliman
Автор

I am mechanical engineering pass out learning DS algo, thank you very much. there are not many Python DS Algo teacher on youtubr

ShivamSharma-dqpu
Автор

I stumbled upon one of your general videos talking about why undergrad in India is better for middle class people. I liked it and want some more videos and discussions like these along with the coding... If you have time, you can make these too

spetsnaz_
Автор

Amazing explanation. Could you please also comment on the runtime?

pranavbapat
Автор

What if the question is to identify majority elements with frequency greater than n/4 ? or generally n/k? How does the algo implementation change then?

AmoghJoshi
Автор

i wrote the code in another way but only one test case not passed which is 75k 1s, problem is time limit exceeding

rangasai
Автор

does the code pass for the input [2, 2, 1, 3]?

keerthanakumaran
Автор

Bhai itna Angrez banne ki kya zaroorat.... araam se bol sakta h bhai yrr.

shahidtauheed
join shbcf.ru