gistfile1.txt
· 261 B · Text
Surowy
create dict
for key, val in l1:
if not dict[k]:
dict[k] = 1
else:
dict[k]++
for key, val in l2:
if not dict[k]:
dict[k] = 1
else:
dict[k]++
let res = []
for key, val in dict:
if val = 2:
res.append(key);
| 1 | create dict |
| 2 | for key, val in l1: |
| 3 | if not dict[k]: |
| 4 | dict[k] = 1 |
| 5 | else: |
| 6 | dict[k]++ |
| 7 | |
| 8 | for key, val in l2: |
| 9 | if not dict[k]: |
| 10 | dict[k] = 1 |
| 11 | else: |
| 12 | dict[k]++ |
| 13 | let res = [] |
| 14 | for key, val in dict: |
| 15 | if val = 2: |
| 16 | res.append(key); |
| 17 |