code to delete the element in the specified location in the array