You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
408 B
TypeScript
17 lines
408 B
TypeScript
import { describe, it, expect } from "vitest";
|
|
import { maxSum } from "./maxSum.ts";
|
|
|
|
describe("maxSum", () => {
|
|
|
|
it("[3, 2, 5, 9, 4 ,1] k=3 answer 18", () => {
|
|
const NUMS = [3, 2, 5, 9, 4, 1];
|
|
expect(maxSum(NUMS, 3)).toBe(18);
|
|
});
|
|
|
|
it("[0, 1, 2, 8, 1 ,11, 10, 0, 0 ,5] k=4 answer 18", () => {
|
|
const NUMS = [0, 1, 2, 8, 1, 11, 10, 0, 0, 5];
|
|
expect(maxSum(NUMS, 4)).toBe(30);
|
|
});
|
|
|
|
});
|