Algorithms/- LeetCode
-
LeetCode - two sumAlgorithms/- LeetCode 2022. 1. 29. 23:16
문제 링크 : two sum Two Sum - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 정답(Solution) class Solution { public int[] twoSum(int[] nums, int target) { //a + b 했을때 타겟을 만드는 코드 int loop = nums.length; int[] answer = new int[2]; //먼저 for문 돌면서 하나씩 하면 되네 for(int index1 = 0; index1 < loop;..