Ad
  • Default User Avatar

    I'm OK with that. The test cases never deal with non-ASCII. Palindromes are also colloquially words not symbols or sequences. Good point though!

  • Custom User Avatar

    It doesn't work with non-ASCI strings.
    Try this:

    Expect(IsPalindrome("топот")).To(Equal(true))
    
  • Default User Avatar

    Your first 2 points are basically the same but good points on performance. I did this as a race and was not focused on cleverness/best-practices. I slapped this together and didn't optimize after it passed. It's not best-practices.

    I did, however, complete this in about 10 minutes. It was fun. I think this was my first CodeWars actually. Good times.

  • Custom User Avatar
    • useless data strutures (no need of Map here: you enforce useless hash computations)
    • overcomplicated stuff (storing each index separately in the map)
    • a lot of copy/paste sections (that makes the code to be a pita when it comes to maintainability => "DRY")
    • you use your lists the wrong way too: you insert and remove at index 0 of an ArrayList. That's the WORST idea you could have had (both operations are O(n) at index 0). So use them the correct way (work at the end) or even better, use the appropriate data structure: a Stack.

    That's really far-far away from "best practices"...