Pregunta de entrevista de Jane Street

a leetcode style question like most