Code for codility Frog jump