String Rotation

Give a string A find lexicographically smallest string possible after circular rotation.

lexicographically smallest: First string in dictionary order.
circular rotation: Pushing the last character to the start.

Constraint
0 < |A| <= 5000
Sample Input 1
BCABDADAB
Sample Output 1
ABBCABDAD

NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a doubt? Checkout Sample Codes for more details.
Start solving String Rotation on Interview Code Editor
Sign Up
to access hints and editorial solutions for String Rotation
1 successful submissions.
Click here to start solving coding interview questions