Rotate String

Given a string *s* and an integer *k*, rotate *s* to the right by *k* positions.

Input Format

Two lines: string s, then integer k.

Output Format

Rotated string.

Constraints

  • 0 <= k < 10^5.

Examples

Example 1:

Input:

s = "abcde"
goal = "cdeab"

Output:

true

Example 2:

Input:

s = "abcde"
goal = "abced"

Output:

false
Loading...
Rotate String - Strings DSA Problem