Two Sum / Hash Map Fundamentals

Problem

Return the indices of the two numbers in the array that sum to a given target. Exactly one valid pair is guaranteed.

Example

[2,7,11,15], target 9 -> [0,1]

Constraints

  • 2 ≤ n ≤ 10^4
added …
LeaderboardSalaryAccount