Given two strings s1 and s2, determine if s2 is a rotation of s1.
A string rotation shifts characters from the front of a string to the back (or vice versa). For example, "waterbottle" can be rotated to "erbottlewat" by moving the first 3 characters to the end.
Return true if s2 is a rotation of s1, and false otherwise.
s1 = "waterbottle", s2 = "erbottlewat"trues1 = "hello", s2 = "llohe"trues1 = "hello", s2 = "world"false0 <= s1.length, s2.length <= 10^5s1 and s2 consist of lowercase English lettersRun your code to see results
Use Cmd+Enter to run