Two Number Sum
easyDescription & examples
Return the indices of two different entries whose sum equals target. Exactly one pair exists. Return the smaller index first.
Examples
numbers = [4, 9, 2, 7], target = 11 → [0, 3]
numbers = [5, 5], target = 10 → [0, 1]
Constraints
2 ≤ length ≤ 10,000. Values and target are integers between -1,000,000 and 1,000,000.
Guided help
Guided help is not available for this problem yet.
