"Check for palindromes" passes with full uppercasing as well
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) Chrome/51.0.2704.84 Safari/537.36
.
Please describe how to reproduce this issue, and include links to screenshots if possible.
My code:
function palindrome(str) {
str = str.toUpperCase().replace(/\W|_/g, '');
return str === str.split('').reverse().join('');
}
palindrome("eye");
A minor issue, but since the instructions state it should be lowercased, a test for lowercasing should be added. Currently it works as long as the case is the same throughout.
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Algorithms 101: How to check if a string is a palindrome
Solution 3: Use Recursion; What to learn next. Ace your coding interview the first time. This learning path will take you through all...
Read more >Java program to check whether a string is a Palindrome
We can check if the given string is a palindrome by comparing the original ... lowercase or uppercase before we check it for...
Read more >JavaScript Algorithms: Checking for Palindromes
In order to check for a palindrome, all we need to do is make sure that the word spells out to exactly how...
Read more >Noisy Palindrome Algorithm (Check Lowercase Palindrome ...
You are given a string s containing lowercase and uppercase alphabet characters as well as digits from “0” to “9”.
Read more >Check string for palindrome - java - Stack Overflow
Why not just: public static boolean istPalindrom(char[] word){ int i1 = 0; int i2 = word.length - 1; while (i2 > i1) {...
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
I can do this one.
Great! 👍
To potential contributors: This issue can be resolved by opening a pull request that changes line 171 of this file as detailed above. Please follow the Contributor’s Guide and remember to visit the HelpContributors chat room if you need any assistance. We’re here to help!