Pergunta de entrevista da empresa Yelp

After I solved the anagram sorting problem, simply by sorting each string first, and then sort the whole string list, he asked me is there any other way that don't need to sort each string. I didn't figure out a better idea.

Resposta da entrevista

Sigiloso

14 de jan. de 2016

from collections import Counter use it to keep count of number of different chars in the string.. for anagram, all u need to see is that component chard of two strings all are present in equal count. sorting is one way to do it, but u need not sort. all u need is char count which Counter would do for u