Most common number
mediumDictionaries20 XP
Return the number that appears most often in nums (it isn't empty). If several numbers are tied, return the smallest of them.
Examples
- Input: nums = [1, 3, 2, 3, 3, 1]Output: 3
- Input: nums = [2, 1, 2, 1]Output: 1
Examples use JSON: true/false/null are True/False/None in Python.