palindrome("0_0 (: /-\ :) 0-0") should return true. It's a bug.
See original GitHub issueChallenge Check for Palindromes has an issue.
User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/48.0.2564.116 Chrome/48.0.2564.116 Safari/537.36
.
Please describe how to reproduce this issue, and include links to screenshots if possible.
My code:
function palindrome(str) {
// Good luck!
var tmpStr = str.replace(/[\s,.!;]/g,"").toLowerCase().replace("-","_");
var reStr = tmpStr.split("").reverse().join("");
if (tmpStr === reStr){
return true;
}else{
return false;
}
}
palindrome("never-odd o_r even");
"0_0 (: /-\ :) 0-0" contains a escape symbol, so it actually is "0_0 (: /- :) 0-0", it isn't a palindrome string.
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
a bug in my Palindrome code . My function runs fine except ...
a bug in my Palindrome code . My function runs fine except when i call ('abba') returns false instead of True . Why...
Read more >Valid Palindrome - Leetcode 125 - Python - YouTube
https://neetcode.io/ - A better way to prepare for Coding Interviews Twitter: https://twitter.com/neetcode1 Discord: ...
Read more >Palindrome Number - Leetcode 9 - Python - YouTube
https://neetcode.io/ - A better way to prepare for Coding Interviews Twitter: https://twitter.com/neetcode1 Discord: ...
Read more >How to Check Palindrome Program? - Java - Great Learning
Conclusion: Here, the string is recursively checked if the letters in the input have equal length. It is a palindrome string if it...
Read more >Two Ways to Check for Palindromes in JavaScript - Medium
But in our test case, we need palindrome(“0_0 (: /-\ :) 0–0”) to return true, which means “_(: /-\ :)–” has to be...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Agreed. It isn’t until you remove all the symbols.
Refer instructions:
Bonus hint: This one is a trick question 😉
If you are still stuck please ask for help in the Help Chat
@raisedadead I wait for your code. Lol!