CodeOath
← All problems

Two Sum

Easy
arrayshash-table

Return the indices of the two numbers that add up to target. Exactly one solution exists.

Example:

Input: nums = [2, 7, 11, 15], target = 9
Output: [0, 1]