Missing One Number In Array
An array contains all the integer from 0 to n, expect for one number which is missing. Find missing number in O(n) in O(1) extra space.
- Sum of firs n natural number [i.e. Sum (1+2+3+………+n)] = n(n+1)/2
- Find sum of array’s of elements
- Find sum of n natural number
- Return sum_of_natural_number – sum_of_array’s_element
Latest Source Code:
Array: [2, 1, 5, 3] N: 5 Missing Number: 4