Pregunta de entrevista de Indeed

mostly general algorithm questions