Question: Given an integer array with the size of (n + 1) which contains numbers from 1 to n but one number is duplicate. Find that

Given an integer array with the size of (n + 1) which contains numbers from 1 to n but one number is duplicate. Find that number in linear time and space. This means you are not allowed to use any kind of nested loop or any additional array apart from the array itself. You are given the array elements in the input, read them one by one unless user press enters. You can assume that there are at most 101 numbers in the input. For example: Input 8 9 7 6 11 10 1 3 2 4 10 5 12 62 39 43 790 89 73 52 23 86 42 31 44 36 68 94 19 41 14 78 6
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
