Pregunta de entrevista de VacuumLabs

they asked one difficult algorithm question