Smallest rotation
Your task
Given a non-empty string s of lowercase letters (1 <= len(s) <= 10^5), return the starting index i (0 <= i < len(s)) such that the rotation s[i:] + s[:i] is lexicographically smallest. If several indices give the same smallest rotation, return the smallest such index.
Examples
smallest_rotation_index(s: str) -> intExample 1
Input
smallest_rotation_index("bbaaccaadd")Output
2