ended3월 20일· 7 sources

First & Last Occurences

정렬된 배열에서 첫 번째 및 마지막 등장 위치 찾기

Why it matters

The author implements an efficient algorithm to find the first and last positions of a target number in a sorted array using two modified binary searches. The first search continues left after finding the target to locate its earliest occurrence, while the second continues right to find the latest, achieving O(log n) time complexity.

7
Sources
+0
24h
Growth
185d
Active
binary searchcoding interviewduplicatesfirst occurrencelast occurrenceo(log n)pythonrotated sorted arraysorted array시간복잡도탐색 알고리즘

Sources

Related Issues