Practice using the cut
Yesterday there was an exercise which introduced the cut. With this exercise you practice to use the cut.
Define a predicate
OutList is obtained by removing the first
X does not occur in
return the list as it is.
Note, that the predicate is supposed to only remove the first occurrence of the specified element. So, you need the cut to stop Prolog from backtracking and deleting later occurrences as well.