Question
An office turnstile logs a badge ID on every entry and every exit. At closing time, everyone has badged in and out — appearing an even number of times — except exactly one person who is still inside and appears an odd number of times. Given the day's log of badge IDs (non-negative integers, in any order), return the ID of the person still inside, using O(1) extra space. For example, [4, 7, 4] returns 7.
find_inside_badge(log: list[int]) → int[[4,7,4]]out7[[10,20,10,30,20]]out30State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.
Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.