![]() |
VOOZH | about |
To remove all the occurrences of an element in an array, we will use the following 2 approaches:
We will keep the same input in all the mentioned approaches and get an output accordingly.
Input:
array = {1, 2, 1, 3, 1}
value = 1
Output:
array = {2, 3}
Explanation: The given value 1 is to be removed from the array of elements. So, the resultant array is {2, 3} after removing the 1 from an array.
2 3
2 3
2 3
2 3