int[] sortByHeight(int[] a) { int b = 0; return a.Select(c => c == -1 ? c : a.Where(d => d != -1).OrderBy(d => d).ToArray()[b++]).ToArray(); }