Syde interview question

To solve a coding challenge in my preferred language