Find the second most frequent element in a list.
MediumProblem Statement
Find the second most frequent element in a list.
Sample Input
[1, 2, 3, 3, 2, 2, 1, 1, 1]
Sample Output
2
Limits
Time: 2s · Memory: 256 MB
Find the second most frequent element in a list.
[1, 2, 3, 3, 2, 2, 1, 1, 1]
2
Time: 2s · Memory: 256 MB