Algorithm for Sanket and Strings

Can you please help me with the algorithm for this question… I am not able to figure it out?

Hey @diganta_7777
Refer to this Please give some hint to solve this problem

Thank You! .

1 Like