Given an array and a value, remove all instances of that value in place and return the new length.