deno.land / x / masx200_leetcode_test@10.6.5 / create-target-array-in-the-given-order / test.ts
123456789101112131415161718192021222324import { assertEquals } from "https://deno.land/std@0.157.0/testing/asserts.ts";
import createTargetArray from "./index.ts";
const { test } = Deno;test("create-target-array-in-the-given-order", () => { const inputs = [ [ [0, 1, 2, 3, 4], [0, 1, 2, 2, 1], ], [ [1, 2, 3, 4, 0], [0, 1, 2, 3, 0], ], [[1], [0]], ]; const outputs = [[0, 4, 1, 3, 2], [0, 1, 2, 3, 4], [1]]; assertEquals( inputs.map((input) => createTargetArray(input[0], input[1])), outputs, );});
Version Info