Write a function that returns the most frequently occurring element in an array.
MediumProblem Statement
Write a function that returns the most frequently occurring element in an array.
Sample Input
[1, 2, 2, 3, 3, 3, 4]
Sample Output
3
Limits
Time: 2s · Memory: 256 MB