Skip to content

Add two pointer solution#5694

Open
P-1256 wants to merge 2 commits intoneetcode-gh:mainfrom
P-1256:add-two-pointer-solution
Open

Add two pointer solution#5694
P-1256 wants to merge 2 commits intoneetcode-gh:mainfrom
P-1256:add-two-pointer-solution

Conversation

@P-1256
Copy link
Copy Markdown

@P-1256 P-1256 commented Apr 12, 2026

Added an alternative approach using sorting and two pointers.

  • Time Complexity: O(n log n)
  • Space Complexity: O(n)

Ensures indices are returned in sorted order.

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