Implement a class LetterSort, which contains a method doSort. doSort takes a
String as a parameter and sorts the characters in the string in order of their
first appearance in the string. For example CABCACCB sorts to CCCCAABB. The
method doSort should return the sorted String.
The method signature is:
public String doSort(String input);
input is a string of at least 1 character and at most 50 characters. The
characters are letters or numbers.
Note:
-The sort is case sensitive. "A" is a different character than "a".
Examples:
If input="TopCoder", the method returns "ToopCder"
If input="HiHowAreYou", the method returns "HHioowAreYu" |