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 9b76509 commit 830cf47Copy full SHA for 830cf47
kamyu104/src/single_number.rs
@@ -1,5 +1,8 @@
1
+// Time: O(n)
2
+// Space: O(1)
3
+
4
#[allow(dead_code)]
-pub fn add(a: i32, b: i32) -> i32 {
5
+pub fn single_number(a: i32, b: i32) -> i32 {
6
// only print when a test fails
7
println!("{}", a + b);
8
return a + b;
@@ -10,8 +13,8 @@ mod tests {
10
13
use super::*;
11
14
12
15
#[test]
- fn test_add() {
- assert_eq!(add(1, 2), 3);
- assert_ne!(add(1, 2), 4);
16
+ fn test_single_number() {
17
+ assert_eq!(single_number(1, 2), 3);
18
+ assert_ne!(single_number(1, 2), 4);
19
}
20
0 commit comments