Open normoes opened 6 years ago
This is about Array Pair Sum.ipynb in Array Sequence Interview Questions - PRACTICE. This notebook is part of lectures 53 and 54.
Array Pair Sum.ipynb
Array Sequence Interview Questions - PRACTICE
Though the notebook is located in the PRACTICE folder, I want to point out that the function returns an incorrect result for pair_sum([1,3,2,2],3).
pair_sum([1,3,2,2],3)
2
1
(1,2)
(2,1)
Maybe this should be added to the list of test cases. Just to make sure all is clear and nobody gets the wrong idea while solving this problem.
pls ignore the Practice folder, check for the solution in the Solutions folder. he used min, max functions to make sure that there is only unique pair in the set.
Ok. Thanks.
This is about
Array Pair Sum.ipynb
inArray Sequence Interview Questions - PRACTICE
. This notebook is part of lectures 53 and 54.Though the notebook is located in the PRACTICE folder, I want to point out that the function returns an incorrect result for
pair_sum([1,3,2,2],3)
.pair_sum([1,3,2,2],3)
is2
.pair_sum([1,3,2,2],3)
should be1
since(1,2)
appears twice ((1,2)
,(2,1)
) but unique sums are searched for.Maybe this should be added to the list of test cases. Just to make sure all is clear and nobody gets the wrong idea while solving this problem.