Write code for Two Sum.
Asked in the technical stage.
Implement two_sum(nums, target). Return the indices of two distinct elements whose values add to target. Assume exactly one solution exists.
two_sum(nums, target)
target
def two_sum(nums, target):
Whenever you're ready, walk me through your approach or go straight to the code. The requirements are in the Question tab.