Most frequent value
Your task
Given a non-empty list of integers nums, return the value that appears most often. If two or more values tie for the highest frequency, return the smallest such value. The list has at least one element.
Examples
most_frequent(nums: list[int]) -> intExample 1
Input
most_frequent([1, 3, 1, 3, 2])Output
1