you give 0indexed integer array num you partition array contiguous subarraysWe partition array valid obtain subarray satisfie follow conditionsthe subarray consist exactly 2 equal element for example subarray 22 goodthe subarray consist exactly 3 equal element for example subarray 444 goodThe subarray consist exactly 3 consecutive increase element difference adjacent element 1 for example subarray 345 good subarray 135 notreturn true array valid partition otherwise return false example 1input num 44456output trueexplanation the array partition subarray 44 456this partition valid return trueexample 2input num 1112output falseexplanation there valid partition array Constraints2 numslength 1051 numsi 106