14671 - Gaura Nitai   

Description

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.

 

 

 The Mercy of Sri Gaura and Sri Nityananda, May 31, Potomac ...

 

 

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.

 

Input

  • The first line contains the string s (may contain spaces).
  • 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)

Output

  • The modified string after moving the substring to the end. (with a newline)

Sample Input  Download

Sample Output  Download




Discuss