Geongong String
Time limit1sMemory limit1024 MB
Given a string S and a window length K, reverse each length-K window from left to right and print the final string.
- Level
Medium5 of 10
- Topics
- Simulation, String, Queue
- Solved
- No attempts yet
Problem
You are given positive integers and , and a string of length made of lowercase English letters.
Define reverse(i) as the operation that reverses the substring of formed by the characters at positions .
Perform reverse(i) for in that order. The final string after all these operations is called the geongong string. Print it.
Input
The first line contains two integers and , separated by a space. ()
The second line contains the string of length , made of lowercase English letters only.
Output
Print the geongong string.
Hint
