While processing item scores for a Coupang ranking workflow, find two distinct array elements whose values add up to a specified target. Return their indices in ascending order.
Implement two_sum(nums, target) using a hash map. You may assume that every valid input contains exactly one solution, and the same array element cannot be used twice.
nums, a list of integers, and target, an integer.[i, j] where i < j and nums[i] + nums[j] == target.def two_sum(nums, target):