JumpGame rewrite - decrease space complexity to O(1)