Pregunta de entrevista de Superhuman

Leetcode medium. Cannot disclose any specifics.