You are given two strings, s1 and s2, determine if s2 is a rotation of s1. You can assume that the rotation operation can be performed on s1 to get s2 if they are rotations of each other. The strings will only contain lowercase English letters.
s1 = "waterbottle"
s2 = "erbottlewat"
True
If 'waterbottle' is rotated, 'erbottlewat' can be formed. ('erbottlewat' is a substring of 'waterbottlewaterbottle')
s1 = "apple"
s2 = "pleap"
True
If 'apple' is rotated, 'pleap' can be formed. ('pleap' is a substring of 'appleapple')
s1 = "apple"
s2 = "ppale"
False
'ppale' cannot be formed by rotating 'apple'.
s1 = "waterbottle"
s2 = "erbottlewat"
True