One Sum

Problem

Given an array of integers nums and an integer target, return indices…

Solution

Use a hash map to track complements in O(n) time.

def twoSum(nums, target):