Your question is Two Sum Practice. 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.
A Macy's cart validation service receives item prices and a target promotional budget. Return the indices of the two distinct items whose prices add exactly to the target.
Implement two_sum(prices, target).
prices is a list of integers, where prices[i] is the price of the item at index i.target is an integer promotional budget.[i, j] where i != j and prices[i] + prices[j] == target.def two_sum(prices, target):