########################################
There are numbers from 1 to N in an array. out of these, one of the number gets duplicated and one is missing. The task is to find out the duplicate number. Conditions: you have to do it in O(n) time without using any auxiliary space (array, bit sets, maps etc..)
Subscribe to:
Post Comments (Atom)
1 comment:
square the array and find the sum to get the solution
Post a Comment