### Problem
Let expected be the heights sorted into nondecreasing order. Return the number of positions i where the current `heights[i]` differs from expected[i]. Equal-height students are indistinguishable for this comparison.
```cpp
class Solution {
public:
int heightChecker(vector<int>& heights);
};
```
### Examples
**Example 1:**
```text
Input: heights = [3,1,2,2]
Output: 3
Explanation: Expected is[1,2,2,3]; positions0,1,3 differ.
```
**Example 2:**
```text
Input: heights = [2,2,4]
Output: 0
Explanation: The current array is already nondecreasing.
```
### Constraints
- The line contains 1 to 100 students.
- Every supplied height is an integer in `[1,100]`.
### Contract considerations
Compare numeric heights at each index; identities among equal heights do not matter.
```hint Read the boundary condition
If equal-height students exchange identities, should a position whose numeric height already matches still count?
```
### Boundary reminders
Compare numeric heights at each index; identities among equal heights do not matter.
Overview: Count Heights Away From Their Sorted Positions. Let expected be the heights sorted into nondecreasing order.
Let expected be the heights sorted into nondecreasing order. Return the number of positions i where the current heights[i] differs from expected[i]. Equal-height students are indistinguishable for this comparison.
class Solution {
public:
int heightChecker(vector<int>& heights);
};