Skip to content

Commit a58aa3d

Browse files
committed
feat: add mock function for trap
1 parent b8ea38b commit a58aa3d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/hard/trapping_rain_water.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#![allow(dead_code)]
2+
3+
pub fn trap(height: Vec<i32>) -> i32 {
4+
todo!("Implement trap function")
5+
}
6+
7+
#[cfg(test)]
8+
mod tests {
9+
use super::*;
10+
11+
#[test]
12+
fn test_trap() {
13+
let height = vec![0, 1, 0, 2, 1, 0, 1, 3, 2, 1, 2, 1];
14+
assert_eq!(trap(height), 6);
15+
}
16+
}

0 commit comments

Comments
 (0)