- Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.test.ts
46 lines (42 loc) · 836 Bytes
/
index.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import*asassertsfrom"https://deno.land/std@0.125.0/testing/asserts.ts";
import*aslogfrom"https://deno.land/std@0.125.0/log/mod.ts";
import{kthSmallestaskthSmallest}from"./index.ts";
log.info("378. Kth Smallest Element in a Sorted Matrix");
Deno.test({
name: `
Input: [[9, 8, 7], [6, 5, 4], [3, 2, 1]]
Output: 1
`,
fn(): void{
constresult: number=kthSmallest(
[
[1,2,3],
[4,5,6],
[7,8,9],
],
1,
);
asserts.assertEquals(1,result);
},
});
Deno.test({
name: `
Input: [
[1, 5, 9],
[10, 11, 13],
[12, 13, 15]
]
Output: 8
`,
fn(): void{
constresult: number=kthSmallest(
[
[1,5,9],
[10,11,13],
[12,13,15],
],
8,
);
asserts.assertEquals(13,result);
},
});