Majority Element | Leetcode 169 |Moore's voting algorithm | Top 150 interview question series

preview_player
Показать описание
Top 150 interview question series
Majority Element
Leetcode problem number 169

JAVA interview programming playlist:

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

Sister the way you explaining blows my mind don't stop teaching you are so good !

sriramongrind
Автор

Mam your teaching is very good👍. Hatsoff to you for explaining the algo so efficiently. Good luck🤞

kaushalbhajne
Автор

But the algorithm is limited to work only if two different elements appears on the array, for more than 2 different elements it won't work. It's kind of restricted functionality.

adolfocarrillo
Автор

A big shout out to you Mam. You made topics clear, simple and explanations were on point. A big thank you for all your efforts. If time permits, I humbly request you to please continue the 150 interview leetcode problems.

iam_phani
Автор

will there will be only 2 types of elements in the array ... suppose [1, 1, 2, 3, 0, 1] here it is 4 diffetnet element ...so what will be output for it.. and 2 or 3 will not try to decrese their point instead of against 1 ..

Harshal-dkkr
Автор

Thank you so much mam, for such simple and accurate explaination.

NewbieValorantYT
Автор

Hi
I'm really grateful for this highly self explanatory piece,
one point that I am in need of clarification: the input is supposed to be 'non-zero', , is that correct please ?

Nonsense
Автор

[6, 5, 5] on that test case answer will be would could you tell me why ??

himanshupokhariya
Автор

Hey these videos are really helping me .... can you please complete these 150 sheets playlist, turn out to best resource for me till now. please🙂🙂

AbhayKumar-xpdy
Автор

you dint verified the case that majority element should be more the n/2 ????

ujjwaldas
Автор

Mam, given example me '3' ka count 1 ayya h lekin apne ko more than '1'(n/2) chaiye tha, apne ko pta h ki '3' total 2 times h lekin question m kese pta chla ki 3 more than 1(n/2) times h, kioki last m to count '1' hi bachha tha, mtlb usne compare kese kiya length se?

mayankarora
Автор

Please mam you continue solve LEETCODE questions

nazim
Автор

It's a Great but wanted to check what will be the case in 1. int [] arr = {3, 2, 3, 2, 4}; and 2. int [] arr = {3, 2, 3, 2, }; ?

SagarDash-nc
Автор

This is only works for these two examples. If the the elements of the array getting longer it won't work.

ahmadfarhadghafoori
Автор

Mam please upload the Leetcode question no 238 Product of Array Except Self

mdayazalam
Автор

The solution does not work for different arrays.

sgautam
Автор

Mam why there are only three types of numbers.?? In array 😢

yash_h
Автор

why u have stop the series you may complete it all

GauravRaj-bikg
Автор

Sir muje VMware me job Leni hai to uske liye kya kya karna padega

Bagulaff
Автор

what if we have two different numbers in last

hulkers