String Rotation
1.9 String Rotation: Assume you have a method isSubstring which checks if one word is a substring of another. Given two strings, 51 and 52, write code to check if 52 is a rotation of 51 using only one call to isSubstring (e.g., "waterbottle" is a rotation of"erbottlewat").
Brainstorm:
if we preform s1+s1 then the result is guaranteed to have the full word within it.
Last updated