10000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cb642a2 commit 23c2e39Copy full SHA for 23c2e39
notes/src/day1/lc704.md
@@ -112,4 +112,18 @@ impl Solution {
112
}
113
114
115
+```
116
+
117
+使用rust std
118
119
+```rust
120
+impl Solution {
121
+ pub fn search(nums: Vec<i32>, target: i32) -> i32 {
122
+ match nums.binary_search(&target) {
123
+ Ok(idx) => { idx as i32 }
124
+ Err(_) => { -1i32 }
125
+ }
126
127
+}
128
129
```
0 commit comments