Solved problem B. Lawnmawer using scala