binary search easy
\nclass Solution:\n    \n    def LIS(self, arr):\n        n = len(arr)\n        dp = [\'None\']*n\n        dp[0] = arr[0]\n        j= 0 \n        for i in range
```\nclass Solution:\n    \n    def LIS(self, arr):\n        n = len(arr)\n        dp = [\'None\']*n\n        dp[0] = arr[0]\n        j= 0 \n        for i in range(1,n):\n            if arr[i]>=dp[j]:\n                dp[j+1] = arr[i]\n                j+=1\n            else:\n                idx = bisect.bisect(dp,arr[i],0,j) # log(n)\n                dp[idx] = arr[i]\n        count = 0\n        for i in dp:\n            if i==\'None\':\n                break\n            count+=1\n        return count\n\n        \n    def kIncreasing(self, arr: List[int], k: int) -> int:\n        ans = 0\n        n  = len(arr)\n        for i in range(k):\n            nums = []\n            for j in range(i,n,k):\n                nums.append(arr[j])\n            ans+=(len(nums)-self.LIS(nums))\n            \n        return ans\n        \n        \n        \n```
['Python', 'Python3']