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 Жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
Great Explanation !! Thank You !! From this Explanation very helpful for me!!
@subhashiniramanathan9321 Жыл бұрын
Great Explanation !! Thank you!
@urs_Gaurav_drdz Жыл бұрын
It fails on multiple test cases😮😢
@harshithanunnaguppala11 ай бұрын
what if the array is 6,6,3,3,4,3,2
@rohitganthade48388 ай бұрын
This code doesn’t work for all the test cases.
@SYD_Technologies3 ай бұрын
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)
@udaybhogi183617 күн бұрын
@@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
@danishansari95747 ай бұрын
this is the code if no majority element: int maj=arr[0]; int coun=1; for(int i=0;i
@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 Жыл бұрын
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 Жыл бұрын
if your sorting a array the efficient time complexity is O(nlogn)