代码重构 【Github Actions】

This commit is contained in:
github-actions[bot] 2021-07-26 16:17:05 +00:00
parent 94d9b4c70f
commit d0abf3e1d8
7 changed files with 11 additions and 10 deletions

View File

@ -140,7 +140,6 @@ func binarySearch(nums []int, target, left, right int) int {
}
```
二分查找的思路及代码已经理解了那么我们来看一下实现时容易出错的地方
1.计算 mid 不能使用 left + right / 2,否则有可能会导致溢出

View File

@ -87,6 +87,7 @@ class Solution {
```
Go Code:
```go
func searchMatrix(matrix [][]int, target int) bool {
if len(matrix) == 0 {

View File

@ -62,6 +62,7 @@ public static int lowBoundnum(int[] nums,int target,int left, int right) {
```
Go Code:
```go
func lowBoundnum(nums []int, target, left, right int) int {