Capco Interview Question

Sort an array. Remove elements from the array. Avoid null pointers.