Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array Pair Sum #8

Open
normoes opened this issue Feb 27, 2018 · 2 comments
Open

Array Pair Sum #8

normoes opened this issue Feb 27, 2018 · 2 comments

Comments

@normoes
Copy link

normoes commented Feb 27, 2018

This is about Array Pair Sum.ipynb in Array 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).

  • The result of pair_sum([1,3,2,2],3) is 2.
  • The result of pair_sum([1,3,2,2],3) should be 1 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.

@bobvo23
Copy link

bobvo23 commented Jun 9, 2020

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.

@normoes
Copy link
Author

normoes commented Jun 9, 2020

Ok.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants