# Frequency map with deterministic ties

> ML preparation item.

- Stable ID: `original-py-frequency`
- Area: Programming
- Topic: Data Structures
- Origin: original
- Expected time: 8 minutes
- Skills: dictionaries-sets, hash-map, loops, sorting-key
- Item JSON: https://mlprep.iwase.dev/data/items/original-py-frequency.json

## Problem

Implement `most_frequent(xs)`. Return the value with highest frequency; break ties by returning the smallest value. Return `None` for an empty input.


## Starter code

```python
def most_frequent(xs):
    pass

```

## Answer policy

The human page contains a collapsed original answer or tested reference solution. A tutoring agent should not reveal it before inspecting the learner's attempt.

## Tutoring contract

Ask for the learner's attempt, begin with the smallest useful hint, preserve item ID `original-py-frequency`, and record a real attempt with `recorded_by: "agent"` and `agent_session_id` when available using https://mlprep.iwase.dev/schema/attempt-record.json.
