Apply suggestions from code review

This commit is contained in:
fwqaaq 2023-11-08 21:09:36 +08:00 committed by GitHub
parent 4134c34c52
commit 040f94472b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -484,6 +484,7 @@ func search(nums: [Int], target: Int) -> Int {
(版本一)左闭右开区间
```rust
use std::cmp::Ordering;
impl Solution {
pub fn search(nums: Vec<i32>, target: i32) -> i32 {
let (mut left, mut right) = (0, nums.len());
@ -503,6 +504,7 @@ impl Solution {
//(版本二)左闭右闭区间
```rust
use std::cmp::Ordering;
impl Solution {
pub fn search(nums: Vec<i32>, target: i32) -> i32 {
let (mut left, mut right) = (0, nums.len());