Group Anagrams in an Array
Problem Statement We have to implement a groupAnagram function that takes an array of strings as input and returns a new array with anagrams grouped. The input string array is assumed to be composed entirely of lowercase English characters. Brute Force Solution If two strings are anagrams then their sorted order will be the same. Thus, anagrams could be grouped under their sorted order. The brute-force implementation of groupAnagram uses a hashmap for grouping....