LeetCode 筆記|1. Two Sum
問題描述
Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.
求數列內,和為目標值的兩數之座標
樣例
Input: nums = [3,2,4], target = 6
Output: [1,2]
限制
2 <= nums.length <= 104
:數列長度介於 2 至 104 之間-109 <= nums[i] <= 109
:數列各項可能有負值-109 <= target <= 109
:目標值可能為負值- Only one valid answer exists.:僅有一組解