1. Last Dictionary String
Write a method which gets a String and returns the last possible word in the dictionary constructed of all that String’s characters. It should follow the following declaration:
public class LastString {
public String lastDictionaryString(String str) {
// TODO: your code
}
}
Input can be any string, output should be constructed from only [a-z] characters.
For example:
Input: "ab5bcc*ccdd", output: "ddccccbba"
Input: "cd2ez-f", output: "zfedc"
Input: "Rg^w4io", output: "wroig"