deno.land / x / masx200_leetcode_test@10.6.5 / design-a-stack-with-increment-operation / 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import { runScript } from "leetcode-class";
import { assertEquals } from "../deps.ts";import CustomStack from "./index.ts";
Deno.test("design-a-stack-with-increment-operation", () => { const e: any[][] = [ [[ "CustomStack", "push", "push", "pop", "push", "push", "push", "increment", "increment", "pop", "pop", "pop", "pop", ], [ [3], [1], [2], [], [2], [3], [4], [5, 100], [2, 100], [], [], [], [], ]], [[ "CustomStack", "push", "pop", "increment", "pop", "increment", "push", "pop", "push", "increment", "increment", "increment", ], [[2], [34], [], [8, 100], [], [9, 91], [63], [], [84], [10, 93], [ 6, 45, ], [10, 4]]], ]; assertEquals(e.map((a) => runScript(a[0], a[1], [CustomStack])), [[ null, null, null, 2, null, null, null, null, null, 103, 202, 201, -1, ], [null, null, 34, null, -1, null, null, 63, null, null, null, null]]);});
masx200_leetcode_test

Version Info

Tagged at
a year ago