Rotate Left by K — Solution & Editorial
Reduce K modulo |S| first, then concatenate the two slices.
Complexity: O(|S|)
Watch out: K can vastly exceed |S| — reduce modulo the length before slicing.
Reduce K modulo |S| first, then concatenate the two slices.
Complexity: O(|S|)
Watch out: K can vastly exceed |S| — reduce modulo the length before slicing.