728x90
반응형
투썸
-
[Leet Code] Two Pointers (투포인터): 167. Two Sum 2 - Input Array Is Sorted - MediumCS기초/Coding Test 2022. 12. 19. 21:37
* Two Pointers 알고리즘 설명 문제 / 코드 개인적으로 medium 중 제일 쉬웠던 문제. Two pointers에서 항상 중앙값을 가지고 풀던 것을 끝 값을 활용하는 것으로 아이디어만 바꾸면 수월하게 풀 수 있는 문제이다. Description Find two numbers such that they add up to a specific target number and return a list of those integers' index in the input array. Condition - The input array is 1-indexed - The array is already sorted in non-decreasing order - There is only one solution ..