Your goal in this kata is to 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`.

```python
array_diff([1,2],[1]) == [2]
```

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

```python
array_diff([1,2,2,2,3],[2]) == [1,3]
```
~~~ if:c
NOTE: In C, assign return array length to pointer *z
~~~

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Data structures

Starter code: def array_diff(a, b):
	

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


def array_diff(a, b):
	set_b = set(b)
	return [i for i in a if i not in set_b]


def array_diff(a, b):
	for i in range(len(b)):
		while b[i] in a:
			a.remove(b[i])
	return a


def array_diff(a, b):
	return [v for v in a if v not in b]


def array_diff(a, b):
	return [value for value in a if value not in b]


def array_diff(a, b):
	for n in b:
		while n in a:
			a.remove(n)
	return a


def array_diff(a, b):
	return [i for i in a if i not in b]


def array_diff(a, b):
	c = []
	for e in a:
		for e2 in b:
			if e == e2:
				break
		else:
			c.append(e)
	return c