Pregunta de entrevista de Marlabs

one sql question and one algorithm