Skip to content

Commit 457513d

Browse files
committed
测试
1 parent 4e350d3 commit 457513d

File tree

5 files changed

+49
-19
lines changed

5 files changed

+49
-19
lines changed

detonate-the-maximum-bombs/index.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ function get_count(edge: number, edges: Map<number, Array<number>>) {
4040

4141
let current = Array.of(edge);
4242
while (current.length) {
43-
// console.log(current)
44-
// const nexts = current.map(a => (edges.get(a) ?? [])).flat()
45-
// const temp = (nexts).filter(i => !visited.has(i))
46-
// temp.forEach(i => visited.add(i))
4743
const temp = new Array<number>();
4844
for (const i of current) {
4945
visited.add(i);
@@ -56,16 +52,8 @@ function get_count(edge: number, edges: Map<number, Array<number>>) {
5652
visited.add(j);
5753
}
5854
}
59-
// next_array?.forEach((j) => {
60-
// if (!visited.has(j)) {
61-
// temp.push(j);
62-
// }
63-
// visited.add(j);
64-
// });
6555
}
66-
// temp.forEach(i=>{
67-
// visited.add(i)
68-
// })
56+
6957
current = temp;
7058
}
7159
// console.log(visited)

detonate-the-maximum-bombs/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { assertEquals } from "https://deno.land/[email protected]/testing/asserts.ts";
1+
import { assertEquals } from "asserts";
22
import maximumDetonation from "./index.ts";
33
Deno.test("detonate-the-maximum-bombs", () => {
44
assertEquals(

diao-zheng-shu-zu-shun-xu-shi-qi-shu-wei-yu-ou-shu-qian-mian-lcof/test.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
import {
2-
assert,
3-
assertEquals,
4-
} from "https://deno.land/[email protected]/testing/asserts.ts";
1+
import { assert, assertEquals } from "asserts";
52
import exchange from "./index.ts";
63

74
Deno.test(

distance-between-bus-stops/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { groupBy, sum } from "../deps.ts";
12
function distanceBetweenBusStops(
23
distance: number[],
34
start: number,
@@ -22,4 +23,3 @@ function distanceBetweenBusStops(
2223
);
2324
}
2425
export default distanceBetweenBusStops;
25-
import { groupBy, sum } from "../deps.ts";

encrypt-and-decrypt-strings/test.ts

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import { assertEquals } from "asserts";
2+
import { runScript } from "leetcode-class";
3+
import Encrypter from "./index.ts";
4+
Deno.test("encrypt-and-decrypt-strings", () => {
5+
assertEquals(
6+
runScript(
7+
["Encrypter", "encrypt", "decrypt"],
8+
[
9+
[
10+
["a", "b", "c", "d"],
11+
["ei", "zf", "ei", "am"],
12+
[
13+
"abcd",
14+
"acbd",
15+
"adbc",
16+
"badc",
17+
"dacb",
18+
"cadb",
19+
"cbda",
20+
"abad",
21+
],
22+
],
23+
["abcd"],
24+
["eizfeiam"],
25+
],
26+
[Encrypter],
27+
),
28+
[null, "eizfeiam", 2],
29+
);
30+
});
31+
32+
Deno.test("encrypt-and-decrypt-strings", () => {
33+
assertEquals(
34+
runScript(
35+
["Encrypter", "encrypt", "decrypt"],
36+
[
37+
[["b"], ["ca"], ["aaa", "cacbc", "bbaba", "bb"]],
38+
["bbb"],
39+
["cacaca"],
40+
],
41+
[Encrypter],
42+
),
43+
[null, "cacaca", 0],
44+
);
45+
});

0 commit comments

Comments
 (0)