Easy to understand code by using LINQ
public class Solution {
public int HeightChecker(int[] heights) {
var orderedHeights = new List<int>(heights);
orderedHeights.Sort();
return heights.Where((t, i) => t != orderedHeights[i]).Count();
}
}