Mercurial > louis > peeves
view arrays/identify_string_rotation/questions.rst @ 0:20fea762903e
Import some exercises and solutions
author | Louis Opter <kalessin@kalessin.fr> |
---|---|
date | Sat, 29 Jun 2013 19:30:31 -0700 |
parents | |
children |
line wrap: on
line source
Identify String Rotation ======================== Assume you have a metho isSubstring which checks if one word is a substring of another. Given two strings, s1 and s2, write a function that checks if s2 is a rotation of s1 using a single call to isSubstring (i.e: "waterbottle" is a rotation of "erbottlewat").