Single Call || Not for Each case seperate case call 
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```cpp []
class Solution {
public:
    int solve(vector<int>& nums, int i, int j, int score,
              vector<vector<int>>& dp) {
        if (i >= j) {
            return 0;
        }

        if (dp[i][j] != -1) {
            return dp[i][j];
        }

        int ans = 0;
        if (score == -1 || nums[i] + nums[i + 1] == score) {
            ans =
                max(ans, 1 + solve(nums, i + 2, j, nums[i] + nums[i + 1], dp));
        }
        if (score == -1 || nums[j] + nums[j - 1] == score) {
            ans =
                max(ans, 1 + solve(nums, i, j - 2, nums[j] + nums[j - 1], dp));
        }
        if (score == -1 || nums[i] + nums[j] == score) {
            ans =
                max(ans, 1 + solve(nums, i + 1, j - 1, nums[i] + nums[j], dp));
        }
        return dp[i][j] = ans;
    }
    int maxOperations(vector<int>& nums) {
        int n = nums.size();
        vector<vector<int>> dp(n + 3, vector<int>(n + 3, -1));
        return solve(nums, 0, n - 1, -1, dp);
    }
};
```

['Dynamic Programming', 'Recursion', 'C++']