update leetcode
This commit is contained in:
6
leetcode_rs/problems/p136/Cargo.toml
Normal file
6
leetcode_rs/problems/p136/Cargo.toml
Normal file
@@ -0,0 +1,6 @@
|
||||
[package]
|
||||
name = "p136"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
11
leetcode_rs/problems/p136/src/main.rs
Normal file
11
leetcode_rs/problems/p136/src/main.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
fn single_number(nums: Vec<i32>) -> i32 {
|
||||
let mut buffer = 0;
|
||||
for num in nums {
|
||||
buffer ^= num;
|
||||
}
|
||||
buffer
|
||||
}
|
||||
|
||||
fn main() {
|
||||
dbg!(single_number([2, 2, 1].to_vec()));
|
||||
}
|
||||
Reference in New Issue
Block a user