mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-09-20 07:43:04 +08:00
Merge 9fc5761058
into ca3d16dcce
This commit is contained in:
commit
7e36cfde1f
28
src/algorithms/string/palindrome/README.zh-CN.md
Normal file
28
src/algorithms/string/palindrome/README.zh-CN.md
Normal file
@ -0,0 +1,28 @@
|
||||
# 回文检测
|
||||
|
||||
[回文](https://en.wikipedia.org/wiki/Palindrome) 是指正向和反向读起来相同的字符串。
|
||||
回文字符串在表现上后半段刚好和前半段倒过来一样。
|
||||
|
||||
## 举例
|
||||
|
||||
以下是一些回文字符串的例子 (返回 `TRUE`):
|
||||
|
||||
```
|
||||
- "a"
|
||||
- "pop" -> p + o + p
|
||||
- "deed" -> de + ed
|
||||
- "kayak" -> ka + y + ak
|
||||
- "racecar" -> rac + e + car
|
||||
```
|
||||
|
||||
以下不是回文字符串 (返回 `FALSE`):
|
||||
|
||||
```
|
||||
- "rad"
|
||||
- "dodo"
|
||||
- "polo"
|
||||
```
|
||||
|
||||
## 参考
|
||||
|
||||
- [GeeksForGeeks - Check if a number is Palindrome](https://www.geeksforgeeks.org/check-if-a-number-is-palindrome/)
|
Loading…
Reference in New Issue
Block a user