Retired

Palindrome (retired)

Description
Loading description...
Fundamentals
View
AllIssues3QuestionsSuggestions2Show Resolved
  • Please sign in or sign up to leave a comment.
  • Bobke Avatar

    Only a small issue:

    My solution only kept letters, and removed both special characters AND numbers (despite the description stating numbers matters). However, it still passed all the tests. I don't think this is intentional.

  • bkaes Avatar

    Duplicate of many other katas.

  • Absurdated Avatar

    One letter test is needed ("0981428 a 9203084"). Even number of letters case is recommended ("ABBA"); Empty string case is needed ("9732908071280", also string.Empty). "Miss by one" examples are needed ("xaxa", "bummud").

  • nramirez Avatar

    I think this kata would be better with another name like 'special palindrome' or 'ninja palindrome', given that it contains some exceptions, also as @parabola949 says, try to improve the description.

  • DiegoBao Avatar

    This comment has been hidden.

  • parabola949 Avatar

    Update description a little more, adding punctuation: Given a word or a sentence, determine if the inverse of the word or sentence is the same as the original. Only letters and numbers matter; ignore special characters and white spaces.

    For instance: < a not e

    Since you specified letters and numbers, it would also be good to have some test cases with numbers

    Test methods: GivenAInvlidPalindromeWithSpecialCharactersOutputShouldBeFalse These are very difficult to read. Would it not be easier to use the string parameter of Assert.AreEqual? Assert.AreEqual(false, Kata.IsPalindrome("Hello ./?!@#$%^&*(){}[];'\|<>,"), "Invalid case with special characters should return false."); Then have a single test method?

  • Fr0sZ Avatar

    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(); }

  • Sailorflares Avatar

    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.

  • krasninja Avatar
    1. Consider to use Assert.True/Assert.False or Assert.That in tests.
    2. There is a typo in GivenAVlidPalindromeWithSpecialCharactersOutputShouldBeTrue test case.
  • fenra Avatar
  • egor-laufer Avatar

    "aha" should return true "ahA" should return true "aha." should return true "a ha" should return true "hello" should return false

    Can this be splitted into multiple lines? It's hard to read this line due to missing formatting.