Commit eb352627 authored by Mathieu Istas's avatar Mathieu Istas
Browse files

corrected exercice finding missing element in list

parent 0eed487f
Pipeline #83738 passed with stage
in 1 minute and 3 seconds
......@@ -1140,10 +1140,12 @@
``` python
from random import shuffle, randint
n = 20
i = randint(0, n-1)
# i = 19 #special case for testing, element at the end of the list
print('integer remove from the list:', i)
l = list(range(n))
l.remove(i)
shuffle(l)
print('shuffled list: ', l)
......@@ -1172,11 +1174,11 @@
if elem != idx:
found = idx
break
if found is None:
found = len(l)
print("missing ", idx)
print("missing ", found)
```
%% Cell type:code id: tags:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment