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.

19 lines
459 B
TypeScript

import { describe, it, expect } from "vitest";
import { twoSumHashTable } from "./twoSumHashTable.ts";
describe("twoSumHashTable", () => {
it("[2,7,11,15], 9 => [0, 1]", () => {
expect(twoSumHashTable([2, 7, 11, 15], 9)).toEqual([0, 1]);
});
it("[3,2,4], 6 => [1, 2]", () => {
expect(twoSumHashTable([3, 2, 4], 6)).toEqual([1, 2]);
});
it("[3, 3], 6 => [0, 1]", () => {
expect(twoSumHashTable([3, 3], 6)).toEqual([0, 1]);
});
});