Learn
Practice
Interview
Resources
Newsletter
F
Toggle theme
0
F
0
Toggle menu
Animations
← Back to All Animations
Majority Element II
Bookmark
Hash Map
Sorting
Boyer-Moore
Input
Input 1
Input 2
No Majority
Custom
nums
=
[3, 2, 3]
3
2
3
0
1
2
value
?
count
0
need
2
result
[]
3
2
3
0
1
2
value
?
count
0
need
2
result
[]
3
2
3
0
1
2
value
?
count
0
need
2
result
[]
3
2
3
i
0
1
2
3:1
value
3
count
1
need
2
result
[]
3
2
3
i
0
1
2
3:1
value
2
count
0
need
2
result
[]
3
2
3
i
0
1
2
3:1
2:1
value
2
count
1
need
2
result
[]
3
2
3
i
0
1
2
3:2
2:1
value
3
count
2
need
2
result
[]
3
2
3
0
1
2
3:2
2:1
value
?
count
0
need
2
result
[]
3
2
3
0
1
2
3:2
2:1
value
3
count
2
need
2
result
[]
3
2
3
0
1
2
3:2
2:1
value
2
count
1
need
2
result
[3]
3
2
3
0
1
2
3:2
2:1
value
?
count
0
need
2
result
[3]
algo
master
.
io
Step:
Start: a majority element must appear at least 2 times
0 / 12
Input
Input 1
Input 2
No Majority
Custom
nums
=
[3, 2, 3]
0 / 12
algo
master
.
io
Step:
Start: a majority element must appear at least 2 times