2. **Problem Description** Reversing the order by splitting a specific point in a string is expressed as rotating the st

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

2. **Problem Description** Reversing the order by splitting a specific point in a string is expressed as rotating the st

Post by answerhappygod »

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) {
}
//
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply