Skip to content

Comments

[Two sum and knapsack ]#1166

Open
takchiks wants to merge 1 commit intosuper30admin:masterfrom
takchiks:master
Open

[Two sum and knapsack ]#1166
takchiks wants to merge 1 commit intosuper30admin:masterfrom
takchiks:master

Conversation

@takchiks
Copy link

No description provided.

@super30admin
Copy link
Owner

Strengths:

  • The twoSum solution is efficient and correctly implemented.
  • The code is well-commented, indicating time and space complexity.
  • The use of HashMap is appropriate and demonstrates understanding of the problem.

Areas for Improvement:

  • The submission includes an extra solution (Problem2) that is not related to the given problem. This is unnecessary and should be avoided. Focus on providing only the solution to the problem asked.
  • While the twoSum solution is correct, it would be good to handle edge cases explicitly (though the problem states there is exactly one solution, so it might not be necessary). However, the return of an empty array when no solution is found is acceptable given the problem constraints.

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

Successfully merging this pull request may close these issues.

2 participants