you give 0indexed integer array num length n the number way partition num number pivot index satisfy conditions1 pivot nnums0 nums1 numspivot 1 numspivot numspivot 1 numsn 1you give integer k you choose change value element num k leave array unchangedreturn maximum possible number way partition num satisfy condition change element Example 1input num 212 k 3output 1explanation one optimal approach change nums0 k the array 312there way partition array for pivot 2 partition 31 2 3 1 2example 2input num 000 k 1output 2explanation the optimal approach leave array unchangedthere way partition array for pivot 1 partition 0 00 0 0 0 for pivot 2 partition 00 0 0 0 0example 3input num 22425201515167191001314 k 33output 4explanation one optimal approach change nums2 k the array 22433201515167191001314there way partition array Constraintsn numslength2 n 105105 k numsi 105