로딩
요청 처리 중입니다...

[Python] LeetCode 1 : Two Sum - level Easy

 [Python] LeetCode 1 : Two Sum  - level Easy

[Python] LeetCode : Two Sum Array 문제 링크 https://leetcode.com/problems/two-sum/ 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 해결 임의의 리스트와 타겟이 주어질 때, 타겟 값을 만들 수 있는 두 수의 인덱스를 구하면 된다. 2중 for문으로 구현하면 되고 중복 계산을 피하기 위해 j는 i + 1부터 시작하면 된다. j를 0부터 시작할 때와 i + 1부터 시작할 때의 차이는 아래와 같다. list = [1, 2, 3, 4, 5, 6], target = 10 0부터 시작할 때 1 + 1 = 2 (i=0, j=0) 1 + 2 = 3 (i=0, j=1) 1 + 3 = 4 (i=0, j=2) . . 2+...