LIS Python
\nfrom bisect import bisect_right as bl\nclass Solution:\n    def lengthOfLIS(self, nums: List[int]) -> int:\n        l = []\n        for i in nums:\n          
```\nfrom bisect import bisect_right as bl\nclass Solution:\n    def lengthOfLIS(self, nums: List[int]) -> int:\n        l = []\n        for i in nums:\n            if not l:\n                l.append(i)\n                continue\n            idx = bl(l,i)\n            if idx==len(l):\n                l.append(i)\n            else:\n                l[idx] = i \n        return len(l)\n    def kIncreasing(self, arr: List[int], k: int) -> int:\n        ans = 0\n        for i in range(k):\n            j = i \n            temp = []\n            while j<len(arr):\n                temp.append(arr[j])\n                j+=k \n            ans += len(temp) - (self.lengthOfLIS(temp))\n        return ans\n```
[]