Search Insert Position (1) 썸네일형 리스트형 [LeetCode] Search Insert Position | 난이도: Easy 문제 Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order. You must write an algorithm with O(log n) runtime complexity. 배열 nums에 target 값과 일치하는 값이 있다면 해당 값의 인덱스를 리턴. 만약 일치하는 값이 없다면 target 값이 있어야 할 위치의 인덱스를 리턴. O(log n) 시간복잡도를 고려한 알고리즘을 작성해야 한다. 예시 Input: nums = [1,3,5,6], targ.. 이전 1 다음