🌈 style(codes/rust): add miss comment in leetcode_two_sums and time_complexity

pull/251/head
xblakicex 2 years ago
parent a5425b6d9b
commit 28e9e4ceb6

@ -35,13 +35,16 @@ impl SolutionHashMap {
}
}
// Driver Code
fn main() {
// ======= Test Case =======
let nums = vec![2,7,11,15];
let target = 9;
// 方法一
let res = SolutionBruteForce::two_sum(&nums, target);
println!("方法一 res = {:?}", res);
// 方法二
let res = SolutionHashMap::two_sum(&nums, target);
println!("方法二 res = {:?}", res);
}

@ -15,6 +15,7 @@ fn constant(n: i32) -> i32 {
count
}
/* 线性阶 */
fn linear(n: i32) -> i32 {
let mut count = 0;
for _ in 0..n {

Loading…
Cancel
Save