Skip to content

Palindrome check · ⁨回文判断⁩

English

Palindrome check

A palindrome reads the same forwards and backwards. Return true if s does, ignoring case and spaces, so Race car counts. Clean the string first (toLowerCase, remove spaces), then compare characters moving inward from both ends.

中文

回文判断

回文正读和反读相同。如果 s 是回文就返回 true,忽略大小写和空格,所以 Race car 也算。先清理字符串(toLowerCase、去掉空格),再从两端向中间逐个比较字符。

Log in or create account · ⁨登录或创建账户⁩

IGCSE, A-Level · ⁨IGCSE、A-Level⁩ & AP · ⁨与 AP⁩