LIS || CPP || Easy to understand
\nclass Solution {\npublic:\nint lengthOfLIS(vector<int>& nums) {\n    \n    //LIS dp approach will give TLE\n        int n=nums.size();\n        vector<int> v;
```\nclass Solution {\npublic:\nint lengthOfLIS(vector<int>& nums) {\n    \n    //LIS dp approach will give TLE\n        int n=nums.size();\n        vector<int> v;v.push_back(nums[0]);\n        for(int i=1;i<n;i++)\n        {\n            if(nums[i]>=v.back()) v.push_back(nums[i]);  \n            else{\n                int idx=upper_bound(v.begin(),v.end(),nums[i])-v.begin();\n                v[idx]=nums[i]; \n            }\n        }\n        return v.size();\n       \n    }\n    \n    \n    int kIncreasing(vector<int>& arr, int k) {\n        \n        int ans=0;\n        int n = arr.size();\n        int temp=0;\n        \n        while(temp<k){\n            vector<int>v;\n            for(int i=temp;i<n;i+=k){\n                v.push_back(arr[i]);\n            }\n            int curr=lengthOfLIS(v);\n            ans+=(v.size()-curr);\n            temp++;\n        }\n        \n        return ans;\n    }       \n};\n\n\n```
['C', 'C++']