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.
Not a bad challenge! Took me some time and thoughts to solve it in O(n) time. The key here is to simply keep track of how many ones are in the last k characters of the original string.
Cipher
You are viewing a single comment's thread. Return to all comments →
Not a bad challenge! Took me some time and thoughts to solve it in O(n) time. The key here is to simply keep track of how many ones are in the last k characters of the original string.