Pregunta de entrevista de NimbleRx

Leetcode medium (on the easy side)