[C++] Easy LIS based solution
Code\n\nclass Solution {\npublic:\n    int kIncreasing(vector<int>& arr, int k) {\n        int ans = 0;\n        for(int i=0;i<k;i++){\n             vector<int>
# Code\n```\nclass Solution {\npublic:\n    int kIncreasing(vector<int>& arr, int k) {\n        int ans = 0;\n        for(int i=0;i<k;i++){\n             vector<int> sorted;\n             sorted.push_back(arr[i]);\n             int size = 1;\n            for(int j=i+k;j<arr.size();j+=k){\n                size++;\n                if(arr[j] >= sorted.back()){\n                sorted.push_back(arr[j]);\n            }\n            else{\n                int it = upper_bound(sorted.begin(),sorted.end(),arr[j]) - sorted.begin();\n                sorted[it] = arr[j];\n            }\n            }\n            ans += ( size - sorted.size());\n        }\n        return ans;\n    }\n};\n```
['C++']