update insertion_sort

This commit is contained in:
Rohit Tanwar
2018-02-20 17:08:10 +05:30
parent 9e7878b00d
commit 7cc78ca4c4
28 changed files with 1252 additions and 1222 deletions

View File

@ -1,14 +1,14 @@
### difference
Returns the difference between two arrays.
Create a `set` from `b`, then use list comprehension to only keep values not contained in `b`
```python
def difference(a, b):
b = set(b)
return [item for item in a if item not in b]
```
``` python
difference([1, 2, 3], [1, 2, 4]) # [3]
### difference
Returns the difference between two arrays.
Create a `set` from `b`, then use list comprehension to only keep values not contained in `b`
```python
def difference(a, b):
b = set(b)
return [item for item in a if item not in b]
```
``` python
difference([1, 2, 3], [1, 2, 4]) # [3]
```