[Java][LeetCode][Hash] Group Anagrams


This problem request to classify by a string of the same letter. I split the string into a character array and sorted it. Restructure the sorted char array to a string and it will be a key to the map. Added original string into the value of the map. At last, get the values of the map to List<List<String>> and return it.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store