Pregunta de entrevista de Jet

Basic algorithm questions on a whiteboard.