We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
HI, may be ur right that 5 doesnot contain any consecutive 1's in its binary form i.e 101(we use word 'consecutive' only if the occurence of item two or more times without any gap).For binary string of 15 answer is 4 because it has 4 consecutive 1's as u mentioned. for example if u sick for 4 continues days, and 5th day u ll say to ur friends that you was sick for 4 consecutive days (not 3 consicutive days). same way here answer is 4 not 3.
Day 10: Binary Numbers
You are viewing a single comment's thread. Return to all comments →
HI, may be ur right that 5 doesnot contain any consecutive 1's in its binary form i.e 101(we use word 'consecutive' only if the occurence of item two or more times without any gap).For binary string of 15 answer is 4 because it has 4 consecutive 1's as u mentioned. for example if u sick for 4 continues days, and 5th day u ll say to ur friends that you was sick for 4 consecutive days (not 3 consicutive days). same way here answer is 4 not 3.
following link may give support to ur doubt about 5 doesnot have consecutive 1's http://www.geeksforgeeks.org/count-number-binary-strings-without-consecutive-1s/
Moderator should clarify this doubt. :-)