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.
Since we are checking every bit of the integer, the time complexity will be O(k) where k is the number of bits/digits in the binary representation of the number n. Hope I am clear.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Consecutive 1's in Binary Numbers
You are viewing a single comment's thread. Return to all comments →
Since we are checking every bit of the integer, the time complexity will be O(k) where k is the number of bits/digits in the binary representation of the number n. Hope I am clear.