Rather than assembling a completely new array, wouldn't it be easier to find the index of the key and remove it from the array?