Array of size n with numbers from 0..n missing exactly one.
n*(n+1)/2
[3,0,1] n=3 → expect 6, sum=4 → missing 2.
[3,0,1]
Input
3 3 0 1
Output
2
2 0 1