Skip to content

Conversation

Vaibhav-Patidar
Copy link

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
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant