Skip to content

Commit 767f7a4

Browse files
committed
fix: two_sum solution
1 parent 01c4a46 commit 767f7a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/two_sum/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub fn two_sum(nums: Vec<i32>, target: i32) -> Vec<i32> {
77
let diff = target - number;
88

99
if let Some(&j) = map.get(&diff) {
10-
return vec![i as i32, j as i32];
10+
return vec![j as i32, i as i32];
1111
}
1212

1313
map.insert(number, i);

0 commit comments

Comments
 (0)