Short Easy C++
\n\nclass Solution {\npublic:\n    int kIncreasing(vector<int>& arr, int k) {\n        int n = arr.size();\n        int ans = 0;\n        for(int i=0;i<k;i++){\
```\n\nclass Solution {\npublic:\n    int kIncreasing(vector<int>& arr, int k) {\n        int n = arr.size();\n        int ans = 0;\n        for(int i=0;i<k;i++){\n            vector<int> lis;\n            int len = 0;\n            for(int j=i;j<n;j+=k){\n                if(lis.empty() || lis.back() <= arr[j]){\n                    lis.push_back(arr[j]);\n                }\n                else{\n                    auto it = upper_bound(begin(lis),end(lis),arr[j]);\n                    if(it == lis.end())lis.push_back(arr[j]);\n                    else *it = arr[j];\n                }\n                len++;\n            }\n            ans += len-lis.size();\n        }\n        return ans;\n    }\n};\n\n```\n
[]