Problem Description

Check if str2 is rotation of str1. Example: "abcd" -> "cdab".
Real Life: Circular string matching.

Step-by-Step Logic:
1. Check if lengths are equal
2. Concatenate str1 with itself
3. Check if str2 is substring of concatenated string
4. If yes, str2 is rotation of str1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next