Viagogo interview question

Hacker Rank coding challenge