EasyArray· 75% acceptance
#163

Two Sum 13

Easy

Given `nums` and `target`, return indices of two distinct numbers that add up to `target`. Exactly one solution exists. Variant **#13**.

Example 1

Input: nums = [13,40,35,6,17,28,39,10,21,32,3,14,25,36,7,18,43], target = 83

Output: [1,16]

nums[1] + nums[16] = 83

Constraints

  • 2 <= nums.length <= 10^4
  • Each input has exactly one solution

Acceptance: 75% · Topics: array, hash-table

twoSum

← All practice problems