deno.land / x / masx200_leetcode_test@10.6.5 / shift-2d-grid / 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
47
48
49
50
51
52
53
54
55
import { assertEquals } from "../deps.ts";import shiftGrid from "./index.ts";
Deno.test("shift-2d-grid", () => { const examples = [ [ [ [1, 2, 3], [4, 5, 6], [7, 8, 9], ], 9, [ [1, 2, 3], [4, 5, 6], [7, 8, 9], ], ], [ [ [3, 8, 1, 9], [19, 7, 2, 5], [4, 6, 11, 10], [12, 0, 21, 13], ], 4, [ [12, 0, 21, 13], [3, 8, 1, 9], [19, 7, 2, 5], [4, 6, 11, 10], ], ], [ [ [1, 2, 3], [4, 5, 6], [7, 8, 9], ], 1, [ [9, 1, 2], [3, 4, 5], [6, 7, 8], ], ], ] as Array<[number[][], number, number[][]]>;
examples.forEach(([grid, k, expected]) => { const actual = shiftGrid(grid, k); // console.log(actual, expected); assertEquals(actual, expected); });});
masx200_leetcode_test

Version Info

Tagged at
a year ago