MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / findpairs

Function findpairs

Python/find pairs.py:3–9  ·  view source on GitHub ↗
(arr,target)

Source from the content-addressed store, hash-verified

1# write a program to find all pairs of integers whose sum is equal to a given number.
2
3def findpairs(arr,target):
4 for i in range(len(arr)):
5 for j in range(i+1,len(arr)):
6 if arr[i]==arr[j]:
7 continue
8 elif arr[i]+arr[j]==target:
9 print(i,j)
10
11
12

Callers 1

find pairs.pyFile · 0.85

Calls 1

printFunction · 0.50

Tested by

no test coverage detected