[HAI] week3 two pointers squares of a sorted array
https://leetcode.com/problems/squares-of-a-sorted-array/
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import { describe, it, expect } from "vitest";
|
||||
import { sortedSquares } from "./sortedSquares.ts";
|
||||
|
||||
describe("sortedSquares", () => {
|
||||
it("[-4,-1,0,3,10] => [0,1,9,16,100]", () => {
|
||||
expect(sortedSquares([-4, -1, 0, 3, 10])).toEqual([0, 1, 9, 16, 100]);
|
||||
});
|
||||
|
||||
it("[-7,-3,2,3,11] => [4,9,9,49,121]", () => {
|
||||
expect(sortedSquares([-7, -3, 2, 3, 11])).toEqual([4, 9, 9, 49, 121]);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user