Implement the Greedy algorithm for the CanJump problem.