Your question is Two Sum Coding Problem. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
In an Antra coding assessment, identify two distinct values in an integer array whose sum equals a specified target. Return the zero-based indices of those values using an approach that runs in linear time.
You may assume that every valid input contains exactly one solution. The same array element cannot be used twice. The returned indices may be in any order, although the examples use increasing order.
Implement two_sum(nums, target).
nums, a list of integers, and target, an integer.i and j such that nums[i] + nums[j] == target and i != j.def two_sum(nums, target):