Polycarp and String Transformation solution codeforces

Polycarp and String Transformation solution codeforces Polycarp has a string ss. Polycarp performs the following actions until the string ss is empty (tt is initially an empty string): he adds to the right to the string tt the string ss, i.e. he does t=t+st=t+s, where t+st+s is a concatenation of the strings tt and ss; he selects an arbitrary letter of ss and removes from ss all…

Read More