Gaura and Nitai were known for their joyful teamwork, often turning ordinary moments into something fresh and harmonious. Inspired by this, imagine a word game they play: Gaura picks a part of the text (between indices l
and r
), and Nitai playfully shifts that piece to the end of the string. The rest of the words remain in place, showing how change can still keep balance.
Task:
Given a string s
and two integers l
and r
, move the substring s[l…r]
to the end of the original string. The rest of the string should remain in the same order.
HINT:
Refer to this article for an explanation of Python slicing.
Refer to this article to learn how to receive multiple inputs in one line.
The second line contains two non-negative integers, start and end (l and r), separated by a space. These define the inclusive indices of the substring to move (zero-indexed)
The modified string after moving the substring to the end. (with a newline)