Find Missing and Repeated Values
Count each value from 1 to n squared; the value counted twice repeats and the value counted zero times is missing.
Count each value from 1 to n squared; the value counted twice repeats and the value counted zero times is missing.