import { describe, it, expect } from "vitest";
import { missingNumber } from "./missingNumber.ts";

describe("missingNumber", () => {

  it("[3, 0, 1] expect 2", () => {
    const nums = [3, 0, 1];
    expect(missingNumber(nums)).toBe(2);
  });

  it("[0, 1] expect 2", () => {
    const nums = [0, 1];
    expect(missingNumber(nums)).toBe(2);
  });

  it("[9, 6, 4, 2, 3, 5, 7 , 0, 1] expect 8", () => {
    const nums = [9, 6, 4, 2, 3, 5, 7, 0, 1];
    expect(missingNumber(nums)).toBe(8);
  });

  it("[0] expect 1", () => {
    const nums = [0];
    expect(missingNumber(nums)).toBe(1);
  });

  it("[1, 2] expect 0", () => {
    const nums = [1, 2];
    expect(missingNumber(nums)).toBe(0);
  });

});
