C++
\nclass Solution {\npublic:\n    int kIncreasing(vector<int>& arr, int k) {\n        int ret = 0;\n        for(int i = 0; i < k; i++){\n            vector<int>g
```\nclass Solution {\npublic:\n    int kIncreasing(vector<int>& arr, int k) {\n        int ret = 0;\n        for(int i = 0; i < k; i++){\n            vector<int>group;\n            for(int j = i; j < arr.size(); j+=k){\n                group.push_back(arr[j]);\n            }\n            ret += LIS(group);\n        }\n        return ret;\n    }\n    \n    int LIS(vector<int>& nums){\n        int n = nums.size();\n        vector<int>Incs;\n        for(auto x : nums){\n            if(Incs.empty() || Incs.back() <= x)\n                Incs.push_back(x);\n            else{\n                auto it = upper_bound(Incs.begin(), Incs.end(), x);\n                int idx = it - Incs.begin();\n                Incs[idx] = x;\n            }\n        }\n        return nums.size() - Incs.size();\n    }\n};\n```
[]