deno.land / x / masx200_leetcode_test@10.6.5 / minimum-score-after-removals-on-a-tree / 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
import { assertEquals } from "../deps.ts";import minimumScore from "./index.ts";
Deno.test("minimum-score-after-removals-on-a-tree", () => { const examples: Array<[nums: number[], edges: number[][]]> = [ [[85, 85, 82, 84, 84, 882, 99, 99, 99, 99], [ [0, 1], [1, 2], [5, 2], [4, 3], [1, 3], [5, 6], [5, 7], [5, 8], [5, 9], ]], [ [1, 5, 5, 4, 11], [[0, 1], [1, 2], [1, 3], [3, 4]], ], [[5, 5, 2, 4, 4, 2], [[0, 1], [1, 2], [5, 2], [4, 3], [1, 3]]], [[3, 8, 8, 9, 8, 6, 9, 10, 30, 2, 22, 26, 16, 17, 26, 32, 22, 7], [ [12, 2], [12, 11], [12, 13], [10, 11], [12, 1], [11, 9], [11, 8], [3, 11], [15, 2], [11, 7], [12, 4], [12, 5], [16, 10], [17, 5], [11, 6], [7, 0], [1, 14], ]], ]; const outputs = [701, 9, 0, 17]; assertEquals(outputs, examples.map((a) => minimumScore(a[0], a[1])));});
masx200_leetcode_test

Version Info

Tagged at
a year ago