🔥🔥🔥C++ | super easy | clean code | LIS | easy to grasp🔥🔥🔥
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\nprivate:\n    int lnds(vector<int>& arr){\n        vector<int> temp;\n        int n = arr.size();\n\n        for(int i=0; i<n; i++){\n            if(temp.size() == 0 || temp.back() <= arr[i]){\n                temp.push_back(arr[i]);\n            }\n            else{\n                int ind = upper_bound(temp.begin(),temp.end(),arr[i]) - temp.begin();\n                temp[ind] = arr[i];\n            }\n        }\n        return temp.size();\n    }\npublic:\n    int kIncreasing(vector<int>& arr, int k) {\n        \n        int n = arr.size();\n        int minOper = 0;\n\n        for(int i=0; i<k; i++){\n            vector<int> subarr;\n            for(int j=i; j<n; j+=k){\n                subarr.push_back(arr[j]);\n            }\n            minOper += subarr.size() - lnds(subarr);\n\n        }\n        return minOper;\n    }\n};\n```
['Array', 'Binary Search', 'C++']