Write a function to check if a string is a rotation of another string.
MediumProblem Statement
Write a function to check if a string is a rotation of another string.
Sample Input
Two strings: str1 = "abcd", str2 = "cdab"
Sample Output
"cdab is a rotation of abcd"
Limits
Time: 2s · Memory: 256 MB