## The challenge

Implement a difference function, which subtracts one list from another and returns the result.

It should remove all values from list `a`, which are present in list `b` keeping their order.

 ``````1 `````` ``````arrayDiff([1,2],) ==  ``````

If a value is present in `b`, all of its occurrences must be removed from the other:

 ``````1 `````` ``````arrayDiff([1,2,2,2,3],) == [1,3] ``````

## The solution in Python

Option 1:

 ``````1 2 `````` ``````def array_diff(a, b): return [x for x in a if x not in b] ``````

Option 2:

 ``````1 2 `````` ``````def array_diff(a, b): return filter(lambda i: i not in b, a) ``````

Option 3:

 ``````1 2 3 4 5 `````` ``````def array_diff(a, b): for i in range(len(b)): while b[i] in a: a.remove(b[i]) return a ``````

## Test cases to validate our solution

 `````` 1 2 3 4 5 6 7 8 9 10 11 12 13 `````` ``````import test from solution import array_diff @test.describe("Fixed Tests") def fixed_tests(): @test.it('Basic Test Cases') def basic_test_cases(): test.assert_equals(array_diff([1,2], ), , "a was [1,2], b was , expected ") test.assert_equals(array_diff([1,2,2], ), [2,2], "a was [1,2,2], b was , expected [2,2]") test.assert_equals(array_diff([1,2,2], ), , "a was [1,2,2], b was , expected ") test.assert_equals(array_diff([1,2,2], []), [1,2,2], "a was [1,2,2], b was [], expected [1,2,2]") test.assert_equals(array_diff([], [1,2]), [], "a was [], b was [1,2], expected []") test.assert_equals(array_diff([1,2,3], [1, 2]), , "a was [1,2,3], b was [1, 2], expected ") ``````