2 DP APPROACH | C++ | BEATS 95% | O(N)
Complexity\n- Time complexity: O(N)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity: O(N)\n Add your space complexity here, e.g. O(n) \n# 1st 
# Complexity\n- Time complexity: O(N)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(N)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n# 1st APPROACH: \n# Code\n```\nclass Solution {\npublic:\n    int dp[10001];\n    int solve(vector<int>& nums, int i, int n){\n        if(i==n) return 0;\n        if(dp[i] != -1) return dp[i];\n        int k=i;\n        while(k<n-1 && nums[k]<nums[k+1]){\n            k++;\n        }\n        int cnt1=k-i+1;\n        int cnt2=solve(nums, k+1, n);\n        \n        return dp[i]=max(cnt1, cnt2);\n    }\n    int findLengthOfLCIS(vector<int>& nums) {\n        memset(dp, -1, sizeof(dp));\n        return solve(nums, 0, nums.size());\n    }\n};\n```\n# 2nd APPROACH: (TLE)\n# Code\n```\nclass Solution {\n    int solveTab(vector<int>& nums, int n){  \n         vector<vector<int>> dp(n+1, vector<int> (n+1, 0));  \n        int ans=0;\n        for(int curr=n-1; curr>=0; curr--){\n            for(int prev=curr-1; prev>=-1; prev--){\n               if(prev==-1 || (nums[curr] > nums[prev]))\n                    dp[curr][prev+1]=1+dp[curr+1][curr+1];\n               \n                ans=max(ans, dp[curr][prev+1]);\n            }\n        }\n        return ans;\n    }\npublic:\n  \n    int findLengthOfLCIS(vector<int>& nums) {\n        return solveTab(nums,nums.size());\n    }\n};\n```
['C++']