Ad
  • Default User Avatar

    What does your code do for this?

    From the description:
    "The path ["NORTH", "WEST", "SOUTH", "EAST"] is not reducible."
    For that case, the input and output should be the same.

  • Custom User Avatar

    Read the description more closely.

  • Custom User Avatar

    What a fucking ride, but I owned it
    edit : wow, the other solutions. I'm so dumb.

  • Default User Avatar

    N W N S S E W N W
    N S == 0
    E W == 0
    S N == 0
    N W W == ANSWER IS W

    E W N S S W W E S N
    E W == 0
    N S == 0
    W E == 0
    S N == 0
    S W == answer sw
    im just saying...

  • Default User Avatar

    First example:

    E W N S N N N E W S N
    E W                   == 0
        N S               == 0
                  E W     == 0
                      S N == 0
            N N N 
    

    By eleminating E W and S N combinations N N N remains. Nothing wrong with this kata.

  • Custom User Avatar

    You could, you know, read the description carefully, for example, or something. But yeah, complaining is also an option ;)

  • Default User Avatar

    this kata is a waste of time

    1. ['EAST', 'WEST', 'NORTH', 'SOUTH', 'NORTH', 'NORTH', 'NORTH', 'EAST', 'WEST', 'SOUTH', 'NORTH'] answer is [ 'NORTH', 'NORTH', 'NORTH'],why not [ 'NORTH']

    ["NORTH", "WEST","NORTH", "SOUTH", "SOUTH", "EAST", "WEST", "NORTH", "WEST"] answer is ['WEST' ], if 1 above is okay, then west west would be okay, or north west like 3 below or just north west

    ['EAST', 'WEST', 'NORTH', 'SOUTH', 'SOUTH', 'WEST', 'WEST', 'EAST', 'SOUTH', 'NORTH'] answer ['SOUTH', 'WEST'] again 2 above cant be north west, then why cant this be just west?

    what a waste of time

  • Default User Avatar

    Post your code with proper markdown and a spoiler tag and I'll take a look.

  • Custom User Avatar

    I have also this problem, I am coding Java.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    @Me2loveit2 Unless if there is an n log n algorithm for finding palindromes in substrings, the worst case should always be n^2. You can do a bunch of micro-optimizations that will make it slightly faster, but nothing to change the worst case.

    PS: Your solution is very jumbled. Couldn't really be bothered to follow it through to the end to figure out the time complexity. But iterating twice over the string with capture matches to find the center of palindromes is already n^2. Then you go through that list and find the centers inside the original string... Why even match them in the first place, if you are just going to find them again? It would make sense that you would time out because you have a bunch of redundancies that are completely unnecessary.

  • Default User Avatar

    i decided to return as much nummbers as the gave me ie boy000>>>boy001, girl099>>>girl100

  • Default User Avatar

    Thanks, found it a while back, am a pro lol

  • Default User Avatar

    thiss the hardest kata i ever did. wtf

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Loading more items...