Skillz interview question

Programming problem on HackerRank related to the role