Find by longest Non Decreasing Sub sequence solution clean
\njavascript\nvar kIncreasing = function (arr, k) {\n  let res = 0,\n    n = arr.length;\n  for (let i = 0; i < k; i++) {\n    const newArr = [];\n    for (let 
\n```javascript\nvar kIncreasing = function (arr, k) {\n  let res = 0,\n    n = arr.length;\n  for (let i = 0; i < k; i++) {\n    const newArr = [];\n    for (let j = i; j < n; j += k) {\n      newArr.push(arr[j]);\n    }\n    res += newArr.length - longestNonDecreasingSub(newArr);\n  }\n  return res;\n};\n\nfunction longestNonDecreasingSub(arr) {\n  const sub = [];\n\n  for (let i = 0; i < arr.length; i++) {\n    const curr = arr[i];\n    if (sub[sub.length - 1] <= curr) {\n      sub.push(curr);\n    } else {\n      let j = 0;\n      while (curr >= sub[j]) {\n        j++;\n      }\n      sub[j] = curr;\n    }\n  }\n  return sub.length;\n}\n```
['JavaScript']