← back to unit
Medium
# queues medium
Rotate the Secret Word
The cipher wheel rotates a word: each turn moves the FIRST letter to the end. 🔄
You get a word and a number of turns k (maybe more than the word's length). Print the rotated word.
Example:
Input: word = "python", k = 2
Output: thonpy
One turn moves p to the end (ythonp); a second turn moves y to the end (thonpy).
💡 need a hint?
q-rotate-word.py🔒 given lines are locked — write your code in between
loading...