python solution (faster 92%)
\tclass Solution:\n\t\tdef longestNonDecreasingSubsequence(self, arr):\n\t\t\tsub = []\n\t\t\tfor i, x in enumerate(arr):\n\t\t\t\tif len(sub) == 0 or sub[-1] <
\tclass Solution:\n\t\tdef longestNonDecreasingSubsequence(self, arr):\n\t\t\tsub = []\n\t\t\tfor i, x in enumerate(arr):\n\t\t\t\tif len(sub) == 0 or sub[-1] <= x:  # Append to LIS if new element is >= last element in LIS\n\t\t\t\t\tsub.append(x)\n\t\t\t\telse:\n\t\t\t\t\tidx = bisect_right(sub, x)  # Find the index of the smallest number > x\n\t\t\t\t\tsub[idx] = x  # Replace that number with x\n\t\t\treturn len(sub)\n\n\t\tdef kIncreasing(self, arr: List[int], k: int) -> int:\n\t\t\tn = len(arr)\n\t\t\tans = 0\n\t\t\tfor i in range(k):\n\t\t\t\tnewArr = []\n\t\t\t\tfor j in range(i, n, k):\n\t\t\t\t\tnewArr.append(arr[j])\n\t\t\t\tans += len(newArr) - self.longestNonDecreasingSubsequence(newArr)\n\t\t\treturn ans
[]