This commit is contained in:
krahets
2024-05-24 16:12:17 +08:00
parent e434a3343c
commit 6bac0db1c4
22 changed files with 635 additions and 99 deletions

View File

@@ -331,7 +331,7 @@ comments: true
if i > j {
return -1;
}
let m: i32 = (i + j) / 2;
let m: i32 = i + (j - i) / 2;
if nums[m as usize] < target {
// 递归子问题 f(m+1, j)
return dfs(nums, target, m + 1, j);