implemented JumpGameII