Skip to content

#1 - Two Sum

EasyArray / String
Open on LeetCode

Given an array of integers nums and a target integer target, return the indices of two numbers in the array that add up to target. You may assume each input has exactly one solution, and you cannot use the same element twice.

InputOutput
nums = [2,7,11,15], target = 9[0,1]
nums = [3,2,4], target = 6[1,2]
nums = [3,3], target = 6[0,1]

Released under the MIT License.