Merge branch 'main' into main

This commit is contained in:
算法基地
2021-07-29 11:44:45 +08:00
committed by GitHub
54 changed files with 1359 additions and 190 deletions

View File

@@ -1,4 +1,4 @@
> 如果阅读时发现错误或者动画不可以显示的问题可以添加我微信好友 **[tan45du_one](https://raw.githubusercontent.com/tan45du/tan45du.github.io/master/个人微信.15egrcgqd94w.jpg)** ,备注 github + 题目 + 问题 向我反馈
> 如果阅读时发现错误或者动画不可以显示的问题可以添加我微信好友 **[tan45du_one](https://raw.githubusercontent.com/tan45du/tan45du.github.io/master/个人微信.15egrcgqd94w.jpg)** ,备注 github + 题目 + 问题 向我反馈
>
> 感谢支持该仓库会一直维护希望对各位有一丢丢帮助
>
@@ -70,23 +70,3 @@ class Solution {
Go Code:
```go
func searchInsert(nums []int, target int) int {
left, right := 0, len(nums) - 1
for (left <= right) {
mid := left + ((right - left) >> 1)
// 查询成功
if nums[mid] == target {
return mid
// 右区间
} else if nums[mid] < target {
left = mid + 1
// 左区间
} else {
right = mid - 1
}
}
return left
}
```