problem
1051. Height Checker
solution
class Solution {
public:
int heightChecker(vector<int>& heights) {
vector<int> orders = heights;
sort(orders.begin(), orders.end());
int res = 0;
for(int i=0; i<heights.size(); i++)
{
if(heights[i]!=orders[i]) res++;
}
return res;
}
};