Skip to content

Commit df17686

Browse files
committed
feat: add a test
1 parent 5e38703 commit df17686

File tree

1 file changed

+17
-2
lines changed
  • number_of_subarrays_with_bounded_maximum/src

1 file changed

+17
-2
lines changed
Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
1+
pub struct Solution {}
2+
3+
impl Solution {
4+
pub fn num_subarray_bounded_max(nums: Vec<i32>, left: i32, right: i32) -> i32 {}
5+
}
6+
17
#[cfg(test)]
28
mod tests {
9+
use super::*;
10+
311
#[test]
4-
fn it_works() {
5-
assert_eq!(2 + 2, 4);
12+
fn example_1() {
13+
let nums = [2, 1, 4, 3];
14+
let left = 2;
15+
let right = 3;
16+
let expected = 3;
17+
assert_eq!(
18+
Solution::num_subarray_bounded_max(nums.to_vec(), left, right),
19+
expected
20+
);
621
}
722
}

0 commit comments

Comments
 (0)