[转载] CS Interview question# Programming - 葵花宝典
l*t
1 楼
【 以下文字转载自 JobHunting 讨论区 】
【 原文由 lhict 所发表 】
Create a function findPalin() that takes a string of characters as argument
and returns the number of palindromes (a string in which the sequence of cha
racters is the same forwards and backwards) in that string. There is no spec
ial character. This function should be as fast as possible.
Ex:
"aa" returns 1
"aabb" returns 2
"222" returns 3
"baaab3" returns 4
【 原文由 lhict 所发表 】
Create a function findPalin() that takes a string of characters as argument
and returns the number of palindromes (a string in which the sequence of cha
racters is the same forwards and backwards) in that string. There is no spec
ial character. This function should be as fast as possible.
Ex:
"aa" returns 1
"aabb" returns 2
"222" returns 3
"baaab3" returns 4