Problem

Solution

You want to find elements in list A that aren't in list B. Erlang provides several ways of doing this:

Use the lists:subtract Function

The lists module provides the subtract function, which takes two list and returns a new copy of the first list, such that the first occurrence of each element of the second list is removed. For example: