[HAI] week3 two pointer palindrome

https://leetcode.com/problems/valid-palindrome/description/
This commit is contained in:
2024-12-05 22:01:21 +03:00
parent f16f797381
commit 35c77a3a23
4 changed files with 157 additions and 0 deletions
+20
View File
@@ -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();
});
});