- Notifications
You must be signed in to change notification settings - Fork97
Create count_pair_with_given_sum.cpp#83
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Added Subarray problem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Hey! Thanks for contributing!
This repository is only for solutions in Javascript. We are also following aspecific format.
I'd be happy to accept this problem but in Javascript.
Thanks again for contributing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Additionally to what Ignacio mentioned, I would also request a change in the solution when you do translate to javascript.
You have an O(N^2) solution, but I believe you can achieve an O(N) solution using a Map/Dictionary that stores the frequency of every number in the array, and then traversing the map to get count of pairs.
Okay will share 0(N) solution soon. |
Added Subarray problem