leetcode
-
Two Sum자료구조와 알고리즘/LeetCode 문제풀이 2020. 6. 24. 13:11
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. 예시) int[] numbers = {1,1,3}; int target = 2; int[] result = solution(numbers, target); // [0, 1] System.out.println(Arrays.toString(result)); 풀이) 정수형 배열에 속하는 두 정수를 더해서 target과 같을 때, 두 ..