Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
That's a feature of
var
, it allows declaring several variables, separated by comma.https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/var
Just curious, syntactically how does the comma before res = []; work? I get the terniary part, but lost on what seems to be something extra with the comma.
Thanks for explaining :)
Thanks for adding! However, the change doesn't show up in my sample test spots. Do I have to reload soemthign?
You are right. I don't understand instructions in 100%. I correct solution.
I've added a extra testcase for even length words.
Thanks for the feedback.
The soloution from user bryjamus managed to pass. So test cases like "abca" are missing. Where first and last letter are the same but is still not a palindrome.
public static bool IsPalindrome(string w)
{
var arr = w.ToLower().ToArray().Where(x=>Char.IsLetter(x));
return arr.First() == arr.Last();
}
I've added the test cases with the special characters to the sample test cases.
Hope this will help.
I have passed all but the last (valid special character test) However, I'm having difficulty debugging because there is no example anywhere of what a 'special character' is, and neither can I see the actual test in the test description.