Skip to content

Latest commit

 

History

History
21 lines (13 loc) · 404 Bytes

Height Checker.md

File metadata and controls

21 lines (13 loc) · 404 Bytes
 int heightChecker(vector<int>& heights) {
        
        vector<int> so;
        so=heights;

        int ans=0;

        sort(so.begin(),so.end());

        for(int i=0;i<heights.size();i++)
            if(heights[i]!=so[i])
                ans++;

        return ans;
    }