3 Recursive Calls Only !!
Code\n\nclass Solution {\npublic:\n    int dp[100003][3];\n    \n    // prev - 0 -> Subarray size is 0\n    // Subarray size is not 0\n    // prev - 1 -> Last e
# Code\n```\nclass Solution {\npublic:\n    int dp[100003][3];\n    \n    // prev - 0 -> Subarray size is 0\n    // Subarray size is not 0\n    // prev - 1 -> Last element of subarray was from nums1\n    // prev - 2 -> Last element of subarray was from nums2\n\n    int f(int ind, int prev, vector<int> &s , vector<int>& t) {\n        if(ind == s.size()) {\n            return 0;\n        }\n        if(dp[ind][prev] != -1)return dp[ind][prev];\n        \n        int skip = 0, pick1 = 0, pick2 = 0;\n        if(prev == 0)skip = f(ind+1, prev, s, t); // skip only when your subarray size is 0\n\n        int val = (prev == 0 ? 0 : prev == 1 ? s[ind-1] : t[ind-1]); // previous value of subarray\n\n        if(prev == 0 || s[ind] >= val) pick1 = 1 + f(ind+1, 1, s, t);\n        if(prev == 0 || t[ind] >= val) pick2 = 1 + f(ind+1, 2, s, t);\n        \n        return dp[ind][prev] =  max({skip, pick1, pick2});\n    }\n    \n    int maxNonDecreasingLength(vector<int>& nums1, vector<int>& nums2) {\n        memset(dp, -1, sizeof(dp));\n        return f(0, 0, nums1, nums2);\n    }\n};\n```
['Dynamic Programming', 'Recursion', 'Memoization', 'C++']