feat: binrary_search

This commit is contained in:
daniel.w 2024-06-23 11:05:16 +08:00
parent 61e416a0ba
commit a085843c28
2 changed files with 5 additions and 1 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.idea/

View File

@ -1,6 +1,9 @@
// 解題影片 https://www.youtube.com/watch?v=98uu0FYPiU8&list=PL-qDGN2q6cbClYCRpJ2pyrlhYK9VjZmL3&index=2
// leetcode https://leetcode.com/problems/remove-element/
fn main() {
// 可變陣列要這樣用 rust
let mut case_a: Vec<i32> = vec![3,2,2,3];
let mut case_a: Vec<i32> = vec![3, 2, 2, 3];
// 傳入時也要帖別聲明 &mut -> &mut case_a
let result = remove_element(&mut case_a, 3);
println!("Result: {}", result);