Remove Element from Array and Return Remaining Elements

Function: Remove specified element from array

Parameters:

- element: the specified element to be removed

- arr: the array from which the element will be removed

Return: rtnArr, the array with the specified element removed.

Steps

  1. Iterate through the array arr and compare each element with the specified element.
  2. If the current element is not equal to element, append it to a new array rtnArr.
  3. Return the newly created rtnArr containing the remaining elements.
txt 文件大小:371B