EASY Longest Increasing Subsequence Solution
Intuition\nobviously ,we can divide the array in almost k independent parts\nnow final answer is just sum of mininum operation in all these parts\n# Approach\n 
# Intuition\nobviously ,we can divide the array in almost k independent parts\nnow final answer is just sum of mininum operation in all these parts\n# Approach\n<!-- Describe your approach to solving the problem. -->\nminimum operation is just the LIS in that part\nand we are done....\n# Complexity\n- Time complexity:\nO(n*logn)\n- Space complexity:\n    O(n)\n# Code\n```\nclass Solution {\npublic:\n    int findlis(vector<int>&v)\n    {\n        vector<int>lis;\n        int n = v.size();\n        for(int i=0;i<n;i++)\n        {\n            auto it = upper_bound(lis.begin(),lis.end(),v[i]);\n            if(it==lis.end())\n            {\n                lis.push_back(v[i]);\n            }\n            else\n            {\n                *it = v[i];\n            }\n        }\n        return lis.size();\n    }\n    int kIncreasing(vector<int>& arr, int k) \n    {   \n        int ans = 0;\n        int n = arr.size();\n        for(int i=0;i<k;i++)\n        {\n            vector<int>cur;\n            int len = 0;\n            for(int j=i;j<n;j+=k)\n            {\n                len++;\n                cur.push_back(arr[j]);\n            }\n            ans+=(len-findlis(cur));\n        }\n        return ans;\n    }\n};\n```
['Binary Search', 'Dynamic Programming', 'C++']