public int maxCoins(int[] nums) {
        if (nums == null || nums.length == 0) return 1;
        if (nums.length == 1) return nums[0];
        cache.clear();
        return (int) search(nums);

    }