Gemini Solutions interview question

Rotate the string wordwise from leetcode