Avatar of gudii9
gudii9
Flag for United States of America

asked on 

wordcount challenge

Hi,

I am working on below challenge.
http://codingbat.com/prob/p117630

The classic word-count algorithm: given an array of strings, return a Map<String, Integer> with a key for each different string, with the value the number of times that string appears in the array.

wordCount(["a", "b", "a", "c", "b"]) → {"b": 2, "c": 1, "a": 2}
wordCount(["c", "b", "a"]) → {"b": 1, "c": 1, "a": 1}
wordCount(["c", "c", "c", "c"]) → {"c": 4}

do i need to worry about sorting like alphabetica in output?
JavaJava EEProgrammingProgramming Languages-OtherSystem Programming

Avatar of undefined
Last Comment
gudii9

8/22/2022 - Mon