我正在尝试解析Leetcode上的面试问题的内容。例如,在https://leetcode.com/problems/two-sum/上, 我在试着得到 Given an array of integers, return indices of thetwo numbers such that they add up to a sp
我正在编写一个函数,给出一个numbers和target_sum的列表,返回的基于零的索引--任何--和等于目标和的两个不同的元素。如果没有这样的元素,则函数应该返回(-1,-1)。这就是我想出的解决办法: def find_two_sum(numbers, target_sum):
"""# I assume the list is