First_non_repeating_number

Run Settings
LanguagePython
Language Version
Run Command
arr = [2, 3, 4, 2, 3, 5] def first_non_repeating(inp): count = {} # First pass: count frequency for i in inp: count[i] = count.get(i, 0) + 1 # Second pass: find first non-repeating for i in inp: if count[i] == 1: return i return None print(first_non_repeating(arr))
Editor Settings
Theme
Key bindings
Full width
Lines