Hello, I have come across this problem floating around the wonderful, amazing, and fantabulous internet just waiting for it to be solved. But I cant so can you guys help me?
Background:
String S of length N is entered.
Input:
First line, number of letter of S, which is N.
On the next line, S is entered.
Output
Created in alphabetical order, the fastest output string.
It looks like the algorithm just wants you to peel the next character(s) closest to 'A' off of either end of the algorithm. It also looks optimized to prefer the back end for the convenience of a straight copy of the last n characters, should that be possible (as it is in the given example). It also appears that the algorithm assumes a c-string layout.