2. **Problem Description** Reversing the order by splitting a specific point in a string is expressed as rotating the st
Posted: Fri Jul 01, 2022 5:39 am
2.
**Problem Description**
Reversing the order by splitting a specific point in astring is expressed as rotating the string.
For example, if you split "Hello" and "World" from thestring "HelloWorld" and rotate it, you get the string"WorldHello".
Given two strings S1 and S2, write a function thatdetermines whether S2 is the result of rotating S1.
[input] string S1, S2
[Output] If string S2 is the result of rotation of S1print '1', otherwise print '0'.
//
function solution(S1, S2) {
}
//
**Problem Description**
Reversing the order by splitting a specific point in astring is expressed as rotating the string.
For example, if you split "Hello" and "World" from thestring "HelloWorld" and rotate it, you get the string"WorldHello".
Given two strings S1 and S2, write a function thatdetermines whether S2 is the result of rotating S1.
[input] string S1, S2
[Output] If string S2 is the result of rotation of S1print '1', otherwise print '0'.
//
function solution(S1, S2) {
}
//