question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

palindrome("0_0 (: /-\ :) 0-0") should return true. It's a bug.

See original GitHub issue

Challenge 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:closed
  • Created 8 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
raisedadeadcommented, Mar 12, 2016

"0_0 (: /-\ :) 0-0" contains a escape symbol, so it actually is "0_0 (: /- :) 0-0", it isn’t a palindrome string.

Agreed. It isn’t until you remove all the symbols.

Refer instructions:

Note You’ll need to remove all non-alphanumeric characters (punctuation, spaces and symbols) and turn everything lower case in order to check for palindromes.

Bonus hint: This one is a trick question 😉

If you are still stuck please ask for help in the Help Chat

1reaction
ShenZQcommented, Mar 12, 2016

@raisedadead I wait for your code. Lol!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found