Count Occurrences of words with Case sensitives

How can we find the occurrences of words in an array of Strings with Case sensitive e.g. [AA, Bb, Aa, aa, BB] ===> {AA=3, Bb=2} [AAa,aaa,BBB,bbb,BbB,AaA,AAc] ===> {AAa=3, BBB=3 , AAc=1} The count should be against the first appearance of the word ConcurrentHashMap<String,Integer> hm = new ConcurrentHashMap<>(); String[] s1 = {"AA", "Bb", "Aa", "aa", "BB"};… Read More Count Occurrences of words with Case sensitives