Find Majority Element ( LeetCode

  Рет қаралды 5,216

TAP ACADEMY

TAP ACADEMY

Күн бұрын

Пікірлер: 14
@Ben-xd7gy
@Ben-xd7gy 10 ай бұрын
thank you so much sir....ur explanation needs a honor....by watching your fantastical explanation for first 5mins....i coded the solution...once again thanks sir
@dhru2512
@dhru2512 Жыл бұрын
Great way of explanation, I am beginner and for me this explanation with slow place and multiple time. Make me understand in more better way than other videos where they just take pen and paper and just walk through the program
@aparajitashambhavee
@aparajitashambhavee Жыл бұрын
Thank you sir....for such a beautifully explained optimal solution! Your content is really commendable....! Thanks a ton for the whole superb playlist , it's really helpful to me....!!
@kdsolutionmaster4672
@kdsolutionmaster4672 Жыл бұрын
Great Explanation !! Thank You !! From this Explanation very helpful for me!!
@subhashiniramanathan9321
@subhashiniramanathan9321 Жыл бұрын
Great Explanation !! Thank you!
@urs_Gaurav_drdz
@urs_Gaurav_drdz Жыл бұрын
It fails on multiple test cases😮😢
@harshithanunnaguppala
@harshithanunnaguppala 11 ай бұрын
what if the array is 6,6,3,3,4,3,2
@rohitganthade4838
@rohitganthade4838 8 ай бұрын
This code doesn’t work for all the test cases.
@SYD_Technologies
@SYD_Technologies 3 ай бұрын
This array doesn't have majority element because n=7 then majority element is greater than the 7/2 = 3 i.e element should appear more than the 3 times 6-2 times 3-3 times 4-1 time 2-1 time there is no element which appearing more than n/2 (>3)
@udaybhogi1836
@udaybhogi1836 17 күн бұрын
@@SYD_Technologies this is the reason that every one tells us to read questions, as in the question it self mentioned that the majority element will be in the array
@danishansari9574
@danishansari9574 7 ай бұрын
this is the code if no majority element: int maj=arr[0]; int coun=1; for(int i=0;i
@saurabhchamoli5204
@saurabhchamoli5204 Жыл бұрын
Can this be a solution when there is majority element. 1.sort an array (0(logn)) 2.int i=1 While(in/2) Break; else Count=0; i++; } Return i-1;
@harshrajushire429
@harshrajushire429 Жыл бұрын
If there is not maj element then value of count will be 1 just use if at the end of loop if count ==1 return -1;
@irshadirshu0722
@irshadirshu0722 Жыл бұрын
if your sorting a array the efficient time complexity is O(nlogn)
Viral Video of a Man's Crazy Job Interview
16:02
Darryl Vega TV
Рет қаралды 1,3 МЛН
小丑家的感情危机!#小丑#天使#家庭
00:15
家庭搞笑日记
Рет қаралды 30 МЛН
How it feels when u walk through first class
00:52
Adam W
Рет қаралды 20 МЛН
REAL 3D brush can draw grass Life Hack #shorts #lifehacks
00:42
MrMaximus
Рет қаралды 8 МЛН
Part 5. Roblox trend☠️
00:13
Kan Andrey
Рет қаралды 2,7 МЛН
Process of Making Handmade Tailored Suits by Korean Master Tailor with 30 years of experience.
25:03
미스터 프로세스 Mr.Process
Рет қаралды 13 МЛН
Language Review: Arabic
21:44
Language Simp
Рет қаралды 430 М.
Космические гипотезы: Как возникло все?
3:51:04
Космическое путешествие
Рет қаралды 752 М.
Стыдные вопросы про Америку / вДудь
2:49:36
100 Most Common Russian Words EVERY BEGINNER MUST KNOW!
28:37
Be Fluent in Russian
Рет қаралды 464 М.
The Volant Vault | Altheya: Side Quest! High Rollers Live
2:42:21
High Rollers DnD
Рет қаралды 26 М.
Roman To Integer - Interview Coding Question -  Leetcode 13 - Tamil
14:49
Think Fast, Talk Smart: Communication Techniques
58:20
Stanford Graduate School of Business
Рет қаралды 41 МЛН
小丑家的感情危机!#小丑#天使#家庭
00:15
家庭搞笑日记
Рет қаралды 30 МЛН