deno.land / x / masx200_leetcode_test@10.6.5 / majority-element / test.ts
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657import { assertEquals } from "https://deno.land/std@0.157.0/testing/asserts.ts";
import majorityElement from "./index.ts";
Deno.test("majority-element", () => { const inputs = [ [3, 2, 3], [2, 2, 1, 1, 1, 2, 2], [ 2, 2, 1, 1, 1, 2, 2, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, ], ]; assertEquals([3, 2, 9], inputs.map(majorityElement));});
Version Info