var heightChecker = function(heights) { let count = 0; const sortedHeights = [...heights].sort((a, b) => a - b); heights.forEach((height, index) => { if(height !== sortedHeights[index]){ count++; } }); return count; };