Write most_common(values) that returns the value appearing most often in the list (the mode). If several values are tied for the highest count, return the smallest of them. Return None for an empty list.
Examples
Input: values = [4, 2, 4, 2, 1]
Output: 2
Explanation: 4 and 2 both appear twice; 2 is smaller.
Input: values = [7]
Output: 7
Constraints
0 <= len(values) <= 5000- all values are integers
Goals
- Count how often each value occurs
- Apply a tie-break rule when several values share the top count