Deqode interview question

Coding round