digio interview question

Leet code easy and hard