We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Data Structures
- Advanced
- Pair Sums
- Discussions
Pair Sums
Pair Sums
Sort by
recency
|
12 Discussions
|
Please Login in order to post a comment
Finally, got the right approach for optimization and solved it.
This was one of the best problems I've come accross on HR so far, in terms of combining mathematical and programming skills, which did not require knowledge of a certain mathematical approach like game theory, graph theory etc, or it may be the case that I just re-invented them.
With all this, and with 70 lines of code, voila, I got full score.
Very well problem definition and let me tell you, ChatGPT will never get you under O(n^2) :)
Easy to understand, detailed solution with step by step explanation and code for both brute force and optimized solution:
https://www.code-recipe.com/post/two-sum
Let me know in comments section if you have any doubts. I will be more than happy to answer.
Please upvote if you found the solution useful. Thank You :)
can some one please explain the problem please i didn't understood what is mean by sub array in the problem
Can anybody Suggest what is the mistake in my code I belive the logic is correct :
This task dose not decribe what defines what is a subarray.