python 3的解决方案是什么?
给定一个整数数组,返回两个数字的索引,使它们相加为特定目标。您可以假设每个输入都只有一个解决方案,并且您不能两次使用相同的元素。
例子:
Given nums = [2, 7, 11, 15], target = 9, Because nums[0] + nums[1] = 2 + 7 = 9, return [0, 1].
python python-3.x
python ×1
python-3.x ×1