You are viewing a single comment's thread. Return to all comments →
Thanks for the easy to understand solution.
I think with Java 8 the code can be compacted a little
int value = map.getOrDefault(currentSubString, 0); if (value > 0) { totalCount += value; } map.put(currentSubString, ++value);
Seems like cookies are disabled on this browser, please enable them to open this website
Sherlock and Anagrams
You are viewing a single comment's thread. Return to all comments →
Thanks for the easy to understand solution.
I think with Java 8 the code can be compacted a little