Majority Elements - I I
easy
1. Given an integer array of size 'n'. 2. Find all elements that appear more than n / 3 times and return it in an arraylist. 3. Note : solve the problem in linear time and in O(1) space.
Constraints
1. 1 <= arr.length <= 10^4 2. -10 ^ 9 <= arr[i] <= 10^9
Format
Input
Input is managed for you
Output
Output is managed for you
Example
Sample Input
3
3 2 3
Sample Output
[3]
Question Video