Group strings that are anagrams | J.P. Morgan Interview Question