Given array of size n containing numbers from 1 to n-1 with one number repeated, find repeated number. question taken from codingninjas.