Created a DFS algorithm for CanJump, but it does not satisfy the time complexity.