Emerald Cloud Lab interview question

- Leet code easy to medium.