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.
Think numerical shifting and not string position shifting.
0 1 2 3 4 5 6 7 8 9
^In a number line, 2 shifted one position to the right is 3. Also 6 shifted one position to the left would be 5. When you shift nine to the right, that's where the "circular" keyword is coming in, imagine it restarts at zero.
The key is to shift each digit, not the string.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Security - Message Space and Ciphertext Space
You are viewing a single comment's thread. Return to all comments →
Think numerical shifting and not string position shifting.
0 1 2 3 4 5 6 7 8 9
^In a number line, 2 shifted one position to the right is 3. Also 6 shifted one position to the left would be 5. When you shift nine to the right, that's where the "circular" keyword is coming in, imagine it restarts at zero.
The key is to shift each digit, not the string.