Pregunta de entrevista de Google Cloud

top-k elements and longest repeating substring