[HAI] week3 two pointer palindrome
https://leetcode.com/problems/valid-palindrome/description/
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { describe, it, expect } from "vitest";
|
||||
import { isPalindrome } from "./isPalindrome.ts";
|
||||
|
||||
describe("isPalindrome", () => {
|
||||
it("A man, a plan, a canal: Panama => true", () => {
|
||||
expect(isPalindrome("A man, a plan, a canal: Panama")).toBeTruthy();
|
||||
});
|
||||
|
||||
it("race a car => false", () => {
|
||||
expect(isPalindrome("race a car")).toBeFalsy();
|
||||
});
|
||||
|
||||
it(" _ => true", () => {
|
||||
expect(isPalindrome(" ")).toBeTruthy();
|
||||
});
|
||||
|
||||
it(" 0P => false", () => {
|
||||
expect(isPalindrome("0P")).toBeFalsy();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user