I have a binary string, say 10111101111 and I want the Most significant not set bit i.e the first 0 starting from the left and the Least significant not set bit i.e. the first 0 from the right.
Basically indices of these two 0s in: 1 0 1111 0 1111
I know the O(n) approach, is there a more efficient way to get these indices?