Your question is Two Sum in Python. 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.
Lyft analyzes pairs of ride fare adjustments that combine to a target value. Given an array of integers 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. Return the indices in any order, and do not use the same array element twice.
nums, a list of integers, and target, an integer.[i, j] such that nums[i] + nums[j] == target.two_sum(nums, target).def two_sum(nums, target):