Array of length N+1
Given an array of length N+1, containing values from 1 to N, find a value that occurs at least twice in O(N) complexity and O(1) space. You cannot change the array in-order.
Given an array of length N+1, containing values from 1 to N, find a value that occurs at least twice in O(N) complexity and O(1) space. You cannot change the array in-order.
Comments