LIS
Code\npython3 []\nclass Solution:\n    def lengthOfLIS(self, nums):\n        a = []\n        for n in nums:\n            if len(a) == 0 or a[-1] <= n:\n        
# Code\n```python3 []\nclass Solution:\n    def lengthOfLIS(self, nums):\n        a = []\n        for n in nums:\n            if len(a) == 0 or a[-1] <= n:\n                a.append(n)\n            else:\n                i = bisect.bisect_right(a, n)\n                a[i] = n\n        \n        return len(a)\n    def kIncreasing(self, arr: List[int], k: int) -> int:\n        res = 0\n        n = len(arr)\n        for m in range(k):\n            subs = arr[m::k]\n            res += len(subs) - self.lengthOfLIS(subs)\n        return res\n        \n```
['Python3']