01 April 2017

Sort by Height

My solution:
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();
}

Previous Next