Skip to content

Instantly share code, notes, and snippets.

@andrewsalmin
andrewsalmin / occurrences_number.py
Last active October 8, 2025 06:02
Find number of occurrences using Counter
from collections import Counter
l = [1, 2, 2, 3, 3, 3]
c = Counter(l)
@andrewsalmin
andrewsalmin / medium.py
Last active September 8, 2025 10:58
Find medium value of 3 numbers
medium = a + b + c - min(a, b, c) - max(a, b, c)