Simple Solution in Java || Easy to Understand
\nclass Solution {\n    public int kIncreasing(int[] arr, int k) {\n        \n        int ans = 0;\n        for(int i=0; i<k; i++){\n            List<Integer> l
```\nclass Solution {\n    public int kIncreasing(int[] arr, int k) {\n        \n        int ans = 0;\n        for(int i=0; i<k; i++){\n            List<Integer> li = new ArrayList<>();\n            \n            for(int j=i; j<arr.length; j += k){\n                li.add(arr[j]);\n            }\n            \n            ans += li.size() - findLengthOfLIS(li); // Total list size minus the length of longest increasing subsequence \n        }\n        \n        return ans;\n    }\n    \n    private int findLengthOfLIS(List<Integer> li){\n        \n        // Find the length of the longest increasing subsequence\n        List<Integer> lis = new ArrayList<>(); // The longest increasing subsequence\n        lis.add(li.get(0));\n        for(int i=1; i<li.size(); i++){\n            if(lis.get(lis.size()-1) <= li.get(i)){\n                lis.add(li.get(i));\n            }else{\n                int index = findNextGreaterIndex(lis, li.get(i));\n                lis.set(index, li.get(i));\n            }\n        }\n        \n        return lis.size();\n    }\n    \n    private int findNextGreaterIndex(List<Integer> lis, int key){\n        int l = 0;\n        int h = lis.size() - 1;\n        \n        while(l < h){\n            int m = l + (h-l)/2;\n            if(lis.get(m) <= key){\n                l = m+1;\n            }else h = m;\n        }\n        \n        return l;\n    }\n}\n```
[]