two sum
-
[LeetCode] Two Sum코딩테스트/LeetCode 2022. 1. 1. 18:02
문제 Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may not use the same element twice. You can return the answer in any order. 정수 배열 nums와 정수 대상이 주어지면 두 숫자의 인덱스를 반환하여 대상에 합산되도록 한다. 각 입력에 정확히 하나의 해답이 있다고 가정하고 동일한 요소를 두 번 사용하지 않을 수 있다. 어떤 순서로든 답변을 반환할 수 ..