A group of students should stand in a line sorted by height.
The sorted arrangement is called expected.
But right now, students are standing in the order given by heights.
Return how many positions in the current order differ from the expected sorted order.
Input: heights = [4,3,2,1]
Output: 4
Explanation:
expected = [1,2,3,4] All four positions are different.
Input: heights = [2,2,2]
Output: 0
Explanation:
expected = [2,2,2] No student is out of place.
Accepted:
Submission: