Why only 2 majority elements for N/3 and 3 for N/4?
Majority Elements
no, am asking that how Kartik told in the vdo that to find element occouring more than N/3 times will at max only be 2 and
@sauzepplin see if you see this test case:
8
2 2 3 1 3 2 1 1
in this case n is 8 and n by 3 is 2 (floor value)
so 1 is coming 3 times
2 is coming 3 times and
3 is coming only 2 times.
so thats why from here we see that only 1 and 2 are according to the constraints.
okay got this one please help me in the other one.
you can mark this thread as resolved then: