Try it on GfG Practice Given two string s1 and s2 of same length, the task is to check whether s2 is a rotation of s1. Examples: Input: s1 = "abcd", s2 = "cdab" Output: true Explanation: After 2 right rotations, s1 will become equal to s2. Input: s1 = "aab", s2 = "aba" Output: true Explanation:…
2025
No articles.