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):