Question: Write in Scala for the following assignment: Define a function named remove that takes an integer atom and a list as parameters (the list does
Write in Scala for the following assignment:

Define a function named remove that takes an integer atom and a list as parameters (the list does not need to be sorted). The function should return a list with the integer removed from it. If the integer occurs multiple times in the list, all occurrences should be removed. For example: remove 3, List (1, 2, 3, 4, 5) 1, 2, 4, 5) remove 3, List(1, 2, 3, 3, 3, 4) 1, 2, 4) remove(3, List (3, 3, 3) = () remove 3, List (2, 4, 6, 8)) (2, 4, 6, 8) Test your code using the interpreter on stdlinux to check your work. As above, use only the elements we have discussed in class to write this code, and provide a solution done without using a while loop
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
