Interview question: Check if one string is a rotation of other string.
- by Webdev
A friend of mine was asked the following question today at interview for the position of software developer.
Given two string s1 and s2 how will you check if s1 is a rotated version of s2 ?
Example: if s1 = "stackoverflow"; then the following are some of its rotated versions:
"tackoverflows"
"ackoverflowst"
"overflowstack"
where as…