Is this your company?
Write a program to count words in a string?
Anonymous
void countWords(String text) { Map wordCount = new HashMap(); List words = Arrays.asList(text.split(" ")); for (String word : words) { if (wordCount.containsKey(word)) { wordCount.put(word, wordCount.get(word) + 1); } else { wordCount.put(word, 1); } } }
Check out your Company Bowl for anonymous work chats.