mirror of
https://hub.njuu.cf/TheAlgorithms/Python.git
synced 2023-10-11 13:06:12 +08:00
updated code
This commit is contained in:
parent
8bf754d373
commit
42d2c138ba
@ -27,7 +27,7 @@ def pairs_with_sum(arr: list, req_sum: int) -> int:
|
||||
>>> pairs_with_sum([1,7,6,2,5,4,3,1,9,8],7)
|
||||
4
|
||||
"""
|
||||
d = {}
|
||||
d:dict = {}
|
||||
for i in arr:
|
||||
if i in d:
|
||||
d[i] += 1
|
||||
|
Loading…
Reference in New Issue
Block a user