Find the Missing Number

easy
Unit 7 · BFS I0/4 to milestone

A list contains n distinct numbers from 0..n, so exactly one is missing. Implement missing_xor(nums) using XOR (O(n) time, O(1) space, no sorting, no sets).

Also implement missing_and_repeated(nums) for a list of length n containing 1..n where one number appears twice and one is missing; return (repeated, missing) using sums and sums of squares.

#bit-manipulation#math2 visible + 1 hidden tests
solution.py · Python 3.13
Loading editor…
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Find the Missing Number · TechGradify