Given an array of integers and an integer n, remove all elements > n or < -n. Shift all remaining elements to the front, and return the new length of the array.