-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestRunner.ts
35 lines (29 loc) · 991 Bytes
/
testRunner.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
const { Solution } = require("./solutions/128.longest-consecutive-sequence"); // Adjust the path as needed
function testRunner() {
const solution = new Solution();
// const examples = [
// ["neet", "code", "love", "you"],
// ["we", "say", ":", "yes"],
// [],
// ["", "", ""],
// ["a", "ab", "abc"],
// ];
const examples = [100, 4, 200, 1, 3, 2];
examples.forEach((example, index) => {
// const encoded = solution.encode(example);
// const decoded = solution.decode(encoded);
const longest = solution.longestConsecutive(example);
console.log(`Example ${index + 1}:`);
// run example, for instance:
// console.log("Input:", example);
// console.log("Encoded:", encoded);
// console.log("Decoded:", decoded);
// console.log(
// "Is valid:",
// JSON.stringify(example) === JSON.stringify(decoded)
// );
console.log(longest);
console.log("-----------------------------------");
});
}
testRunner();