Your question is Two Sum Array Coding. 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.
Iris software's developer tooling needs to identify a pair of positions in an integer sequence whose values match a requested total. Given an array nums and an integer target, return the indices of two distinct elements whose values add up to target.
You may assume that every valid input contains exactly one solution. The same array element cannot be used twice. Return the indices in ascending order of discovery, with the smaller index first.
nums, an array of integers, and target, an integer.[i, j] such that i < j and nums[i] + nums[j] == target.def two_sum(nums, target):