A school is trying to arrange students in nondecreasing order of their heights. You are given an integer array heights representing the current order of the students.
Let expected be the array representing heights sorted in nondecreasing order.
Return the total number of indices i where heights[i] \neq expected[i].
Constraints:
heights.length
heights[i]
A school is trying to arrange students in nondecreasing order of their heights. You are given an integer array heights representing the current order of the students.
Let expected be the array representing heights sorted in nondecreasing order.
Return the total number of indices i where heights[i] \neq expected[i].
Constraints:
heights.length
heights[i]