C++ || LIS
\nint lis(vector<int>& v){\n        \n        vector<int> seq;\n        \n        for(int i=0; i<v.size(); i++){\n            \n            if(seq.empty() or se
```\nint lis(vector<int>& v){\n        \n        vector<int> seq;\n        \n        for(int i=0; i<v.size(); i++){\n            \n            if(seq.empty() or seq.back() <= v[i]) seq.push_back(v[i]); \n            else{\n                int idx = upper_bound(seq.begin(), seq.end(), v[i]) \n                            - seq.begin();\n                seq[idx] = v[i];\n            }\n        }\n        return seq.size();\n    }\n    \n    int kIncreasing(vector<int>& arr, int k) {\n        \n        int n = arr.size();\n        int ans=0;\n        \n        for(int i=0; i<k; i++){\n            \n            vector<int> v;\n            \n            for(int j=i; j<n; j+=k){\n                v.push_back(arr[j]);\n            }\n            \n            ans += v.size() - lis(v);\n        }\n        \n        return ans;\n    }\n```
[]