Download 130/solution/_reference.py from PRHW/loom-benchmark-mbpp: direct link, hf CLI and curl.
- Browser
- Download file 204 Bytes
-
https://huggingface.co/datasets/PRHW/loom-benchmark-mbpp/resolve/main/130/solution/_reference.py
- Command line
-
hf download hf://datasets/PRHW/loom-benchmark-mbpp/130/solution/_reference.py
-
curl -L -o _reference.py https://huggingface.co/datasets/PRHW/loom-benchmark-mbpp/resolve/main/130/solution/_reference.py
204 Bytes
| from collections import defaultdict | |
| def max_occurrences(nums): | |
| dict = defaultdict(int) | |
| for i in nums: | |
| dict[i] += 1 | |
| result = max(dict.items(), key=lambda x: x[1]) | |
| return result[0] |