[HAI] twoSumHashtable

This commit is contained in:
2024-11-23 04:33:24 +03:00
parent 0cabf5961f
commit 1eddd38b3f
3 changed files with 41 additions and 0 deletions
@@ -0,0 +1,14 @@
import { describe, it, expect } from "vitest";
import { twoSumHashTable } from "./twoSumHashTable.ts";
describe("twoSumHashTable", () => {
let sortedArray = [-12, 1, 4, 6, 22];
it("twoSumHashTable", () => {
expect(twoSumHashTable(sortedArray, 4)).toBe(2);
});
it("twoSumHashTable", () => {
expect(twoSumHashTable(sortedArray, 3)).toBe(-1);
});
});