Two Sum
-
leetcode easy - Two Sum개발 나누고 더하기/코딩 테스트 2023. 6. 14. 22:33
문제 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. Integer 타입의 배열이 있고, 이중 2개를 뽑아 더해서 target과 같은 값이 나오는 인덱스를 반환해야 한다. 예제 1 Input: nums = [2,7,11,15], target = 9 Output: [0,1] Ex..