DraftKings interview question

Code a solution to given HackerRank problem