Skip to content

Commit

Permalink
Solution to today's problem
Browse files Browse the repository at this point in the history
  • Loading branch information
spannm committed Mar 29, 2024
1 parent 03c50a2 commit a876398
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package io.github.spannm.leetcode.lc2.lc2900;

import io.github.spannm.leetcode.LeetcodeBaseTest;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.converter.ConvertWith;
import org.junit.jupiter.params.provider.CsvSource;

class Problem2962Test extends LeetcodeBaseTest {

@ParameterizedTest(name = "[{index}] {0}; {1} --> {2}")
@CsvSource(delimiter = ';', value = {
"1,3,2,3,3; 2; 6",
"1,4,2,1; 3; 0"
})
void test(@ConvertWith(CsvToIntArray.class) int[] nums, int k, long _expectedResult) {
assertEquals(_expectedResult, new Problem2962().countSubarrays(nums, k));
}

}

0 comments on commit a876398

Please sign in to comment.