Two Sum: Find Indices of Two Numbers Summing to Target

Asked at Visa · Coding Questions · Difficulty: Easy

Given an array of integers `nums` and an integer `target`, return the indices of the two numbers such that they add up to `target`. You may assume exactly one solution exists, and you may not use the same element twice.

Loading the problem…