Skip to content

feat: add LeetCode problem 167 - #1504

Closed
Vaibhav-Patidar wants to merge 1 commit into
TheAlgorithms:masterfrom
Vaibhav-Patidar:solution/two-sum-ii
Closed

Vaibhav-Patidar wants to merge 1 commit into
TheAlgorithms:masterfrom
Vaibhav-Patidar:solution/two-sum-ii

Conversation

@Vaibhav-Patidar

Copy link
Copy Markdown

Description of Change

Implemented the Two Sum II solution using the two-pointer approach. The function takes a sorted array and returns the 1-based indices of the two numbers whose sum equals the given target. It uses a single pass with O(n) time complexity and O(1) extra space. The result array is dynamically allocated, with memory management handled by the caller.

Checklist

  • Added description of change
  • Added file name matches File name guidelines
  • Added tests and example, test must pass
  • Relevant documentation/comments is changed or added
  • PR title follows semantic commit guidelines
  • Search previous suggestions before making a new one, as yours may be a duplicate.
  • I acknowledge that all my contributions will be made under the project's license.

Notes: Added the solution for Leetcode problem no.167 Two-Sum-II

@github-actions github-actions Bot added the Leetcode folder changes Changes to Leetcode folder. Known CI issues. label Oct 20, 2025
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions Bot added the Stale label Nov 20, 2025
@github-actions

Copy link
Copy Markdown
Contributor

Please ping one of the maintainers once you commit the changes requested or make improvements on the code. If this is not the case and you need some help, feel free to ask for help in our Gitter channel or our Discord server. Thank you for your contributions!

@github-actions github-actions Bot closed this Nov 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Leetcode folder changes Changes to Leetcode folder. Known CI issues. Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant