There is an infinite sequence b, such that b[i] = 1 , if the binary representation of i has odd number of 1s, and b[i] = 0 , otherwise. Given a sub sequence of 0s and 1s, I am required to find the starting index of a match, if one exists or state that a match doesn't exist if it doesn't. What is an efficient way to do it?
Asked
Active
Viewed 14 times
0
-
The "number of ones" is also known as the "Hamming weight". – Emilien Jun 07 '16 at 09:42
-
Okay, anyone knows how to solve it? I still haven't got a method to solve it, let alone find an efficient solution. – user3760100 Jun 18 '16 at 06:47