you give integer array arr length n represent permutation integer range 0 n 1we split arr number chunk ie partition individually sort chunk after concatenate result equal sorted arrayreturn large number chunk sort array Example 1input arr 43210output 1explanationsplitting chunk return require resultfor example split 4 3 2 1 0 result 3 4 0 1 2 is not sortedexample 2input arr 10234output 4explanationwe split chunk 1 0 2 3 4however splitting 1 0 2 3 4 high number chunk possible Constraintsn arrlength1 n 100 arri nAll element arr unique