CPP solution!!
\n\n# Complexity\n- Time complexity:\nO(nlogn)\n\n- Space complexity:\n Add your space complexity here, e.g. O(n) \n\n# Code\n\nclass Solution {\nprivate:\n    
\n\n# Complexity\n- Time complexity:\nO(nlogn)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\nprivate:\n    int findIndex(vector<int>& arr, int val) {\n        int l = 0;\n        int r = arr.size();\n\n        while(l < r) {\n            int m = l + (r-l)/2;\n\n            if(val >= arr[m]) {\n                l = m+1;\n            } else {\n                r = m;\n            }\n        }\n        return l;\n    }\npublic:\n    int kIncreasing(vector<int>& arr, int k) {\n        int res = 0;\n\n        for(int i=0;i<k;i++) {\n            vector<int> temp;\n            for(int j=i;j<arr.size();j=j+k) {\n                if(temp.empty() || temp[temp.size()-1] <= arr[j]){\n                    temp.push_back(arr[j]);\n                } else {\n                    temp[findIndex(temp, arr[j])] = arr[j];\n                }\n            }\n            res += temp.size();\n        }\n        return arr.size()-res;\n    }\n};\n```
['C++']