Solved P19 and P20 with splitAt scala function