Pregunta de entrevista de KCG

- SQL query - implementing algorithm with O(n) complexity