You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ringo found a string s of length n in his yellow submarine. The string contains only lowercase letters from the English alphabet. As Ringo and his friends love palindromes, he would like to turn the string s into a palindrome by applying two types of operations to the string.
The first operation allows him to choose i (2≤i≤n−1) and to append the substring s2s3…si (i−1 characters) reversed to the front of s.
The second operation allows him to choose i (2≤i≤n−1) and to append the substring sisi+1…sn−1 (n−i characters) rever