given sorted array 0,1...n find duplicates or missing