面试准备

最近改动

更新题目 找二分查找里的 bug

题目 everpure-oa-binary-search-bug · 修改(rev 6) · cc · 2026-10-27 12:09

body

@@ -21,6 +21,4 @@
 - **漏掉找不到的情况**:循环结束后没有检查 `a[lo] == target`。
 - **重复元素**:要找第一个出现的位置,却在相等时直接返回。
-
-## 英文讲法
 
 > [!say] I first pin down the interval convention, closed or half-open, and then check the three things that usually break: the loop condition, whether each branch strictly shrinks the interval, and what happens when the target isn't there.