
Let 'N' = 6, 'A' = [1, 2, 2, 3, 4, 2], 'E' = 2.
The resulting array after removing all occurrences of 2 is [1, 3, 4].
The first line contains two integers, 'N' and 'E', separated by a space.
The second line contains 'N' integers representing the elements of the array 'A', separated by spaces.
Return the modified array with all occurrences of 'E' removed.
You don’t need to print anything. Just implement the given function.
1 <= 'N' <= 10^5
-10^9 <= elements of 'A', 'E' <= 10^9
Time Limit: 1 sec
Approach:
Algorithm: