Code Room
CodingEasycod-g1498
Subject Bit manipulationLevel Entry–Mid~10 minCommon in Algorithms & data structures interviewsIndustries Software development

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.

Implement
find_inside_badge(log: list[int]) → int
Examples
in[[4,7,4]]out7
in[[10,20,10,30,20]]out30
What a strong answer looks like

State 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.

Run or narrate your approach, then ask the coach.