you give integer array num length n represent permutation integer range 0 n 1the number global inversion number different pair j where0 j nnumsi numsjThe number local inversion number index where0 n 1numsi numsi 1return true number global inversion equal number local inversion example 1input num 102output trueexplanation there 1 global inversion 1 local inversionExample 2input num 120output falseexplanation there 2 global inversion 1 local inversion Constraintsn numslength1 n 1050 numsi nAll integer num uniquenum permutation number range 0 n 1