Question: 7. Rotate a string pubtic class StringRotation Given a word, a rotation is found by moving one letter from the head to the tail of

7. Rotate a string pubtic class StringRotation Given a word, a rotation is found by moving one letter from the head to the tail of the word. For example, the word 'orange' rotated once is 'rangeo', rotated twice is 'angeor', rotated thrice is 'ngeora'. Function Description Write a method rotate(s, n) that takes two arguments, a string s public static void rotate(String s, int n ) and an int n, that rotates a given string s,n times. Constraints - sis a string - n is an integer >0 - You have to use a loop in your solution \begin{tabular}{r|l} 8 & \\ 9 & \} \\ 10 & public static void ma \\ 11 & \{ \\ 12 & \} \\ 13 & \} \\ 14 & \end{tabular}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
