ServiceNow interview question

Leetcode 49 Group Anagrams