欢迎24级新生

2057. LeetCode Two Sum

Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may not use the same element twice.

输入

nums = [2, 7, 11, 15], target = 9,

输出

[0, 1]

提示

在数组中找到 2 个数之和等于给定值的数字,结果返回 2 个数字在数组中的下标。

登录以提交代码。
单点时限 1 秒
内存限制 128 MB
提交 0
通过 0