Solve first HackerRank FP challenge