Pregunta de entrevista

Entrevista de Search and Data Mining Engineer



List the strings that are anagrams from a set of strings?


Respuestas de entrevistas

2 respuestas


Sorting the strings is not optimal because each sort is O(N log N) where N is the number of characters in each word. A more optimal solution is to create a function to encode each word as a hash table of character frequencies, which is O(N) for each word.

Anónimo en


sort the strings and compare

Anónimo en

Añadir respuestas o comentarios

Para publicar un comentario sobre esto, inicia sesión o regístrate.