Your question is Two-Sum Array 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.
Within a CEVA Logistics shipment planning workflow, two scanned shipment values may need to be checked against a required combined total. Given an integer array nums and an integer target, return the indices of two distinct elements whose values add up to target.
Return the indices in ascending order. Each input is guaranteed to contain exactly one valid pair, and the same array element cannot be used twice.
Implement two_sum(nums, target):
nums, a list of integers, and target, an integer.def two_sum(nums, target):