Pregunta de entrevista de Nextdoor

Basic algorithm based problems, nothing complicated