← DSA practice

Two Sum II Input Array Is Sorted

MediumTwo Pointers

The problem

Given a sorted array and a target, find the two numbers that add up to it and return their 1-based positions.

Full statement, examples and constraints: see the original problem link below.

Solve it on LeetCode