Loading...
Loading...
Loading...
A form has numbered pages from 0 to n. One page is missing from the stack of n pages. Print the missing page number.
Example
Input
3 3 0 1
Output
2
Page 2 is missing.
Try the problem first. Open one hint at a time.
The sum of 0 to n is known, but XOR also works and cannot get large.
XOR n, every index and every value together.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor