Code 10
Code 10
One day she found a string and an integer. As an advanced problem setter, she quickly thought of a
problem.
Given a string ss and a parameter kk, you need to check if there exist k+1k+1 non-empty
strings a1,a2...,ak+1a1,a2...,ak+1, such that
s=a1+a2+…+ak+ak+1+R(ak)+R(ak−1)+…+R(a1).s=a1+a2+…+ak+ak+1+R(ak)+R(ak−1)+
…+R(a1).