logo CodeStepByStep logo

isRotation

Language/Type: C++ string parameters return boolean
Related Links:

Write a function named isRotation that accepts two strings as parameters and returns true if they are rotations of each other. Two strings are considered rotations if they contain the same characters in the same relative order when wrapped around. For example, the call of isRotation("abcde", "deabc") should return true. The call of isRotation("abcde", "edcba") should return false because the characters are not in the same order. A string is also considered to be its own rotation.

Function: Write a C++ function as described, not a complete program.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.