complement function
The elements of a list that are in none of the others.
How to write it
complement(all, others, ...)
- all
- The list to take elements from. Takes a list.
- others
- A list of elements to leave out. Takes a list.
Examples
complement([1, 2, 3], [2])In the solver,
Open in the solvercomplement([1, 2, 3], [2])gives[1, 3].
Related functions
- constant_array
A list of copies of a value.
- apply
Replace the head of an expression, or the brackets of a list, with a function.
- count
How many elements of a list equal a value.
- append
A list with an element added at the end.
- dimensions
The size of a list or a matrix, level by level.
- accumulate
Running totals of a list.