freecodecamp.cn icon indicating copy to clipboard operation
freecodecamp.cn copied to clipboard

题目错误

Open VZIKL opened this issue 9 years ago • 7 comments

check-for-palindromes的palindrome("0_0 (: /-\ :) 0-0")

VZIKL avatar Dec 12 '16 07:12 VZIKL

原题目确实是这样的袄

discountry avatar Dec 19 '16 10:12 discountry

@discountry 我是想说这个字符串怎么看都不是回文吧? :D 一个0-0 一个0_0

VZIKL avatar Dec 19 '16 23:12 VZIKL

@VZIKL 你没有完整理解题目意思袄。

discountry avatar Dec 20 '16 00:12 discountry

题目确实没有问题,但是,“\”在字符串里会被认成转义字符的前导符,所以才会导致这个例子通不过。

AnClark avatar Jul 09 '17 08:07 AnClark

@AnClark 如果例子通不过,那多半是代码中的正则写的有问题。换个思路写就可以了。 另外,就算是“前导符”也不影响,因为反正后面是一个空格

S1ngS1ng avatar Jul 09 '17 22:07 S1ngS1ng

Same problem. The expression "0_0 (: /-\ :) 0-0" is in fact 0_0 (: /- :) 0-0, therefore not symmetric. A correct function will return false.

Lilysunstrider avatar Oct 24 '17 12:10 Lilysunstrider

@Lilysunstrider Please post your "correct" function here. According to the description, you should only check for alphabets (case insensitive) and numbers. Hence all symbols (including spaces) should be removed.

S1ngS1ng avatar Oct 24 '17 13:10 S1ngS1ng