One approach would be to use a loop to get each character and use a Map<String, CounterClass> to save the counts. CounterClass would be a class you wrote to save the counts in.
Another approach would depend on if the characters are restricted to 26 uppercase letters. In that case a 26 element array could be used with the char value used to index the array.
posted 1 year ago
how can i print the characters in alphabetical order , i think we need to sort the HashMap