Company: Practo_SDE_Intern_
Difficulty: medium
Left Rotation of a String Problem Statement Given two strings s1 and s2 , determine if s2 is a left-rotation of s1 . A left-rotation here means that you take some number of characters from the beginning of the string s1 and append them to the end of s1 to form s2 . If s2 is a left-rotation of s1 , return the number of characters rotated. Otherwise, return -1 . Examples Example 1: Input: s1 = "abcde", s2 = "deabc" Output: 3 Explanation: By rotating the first 3 characters ("abc") of s1 to the end, we get "deabc", which is equal to s2. Example 2: Input: s1 = "hello", s2 = "lohel" Output: 3 Explanation: By rotating the first 3 characters ("hel") of s1 to the end, we get "lohel", which is equal to s2. Constraints 1 <= s1.length, s2.length <= 100 Both strings consist of lowercase English letters only.