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.
- Prepare
- Algorithms
- Bit Manipulation
- Cipher
- Discussions
Cipher
Cipher
Sort by
recency
|
111 Discussions
|
Please Login in order to post a comment
C++
Here is Cipher problem solution in Python Java c++ and c programming - https://programs.programmingoneonone.com/2021/07/hackerrank-cipher-problem-solution.html
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.
def cipher(k, s):