Ad
  • Default User Avatar

    Try making sure this case works, near the bottom of the description:

    "The path ["NORTH", "WEST", "SOUTH", "EAST"] is not reducible."
    The input and output should be the same for that example.

  • 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

  • Custom User Avatar

    Apparently you do not understand task well ;)

    Not a kata issue. Description mentions several times that only directions immediately following one another can be reduced.

  • Custom User Avatar

    Maybe some issue in c# tests
    Description says
    "In ["NORTH", "SOUTH", "EAST", "WEST"], the direction "NORTH" + "SOUTH" is going north and coming back right away.
    The path becomes ["EAST", "WEST"], now "EAST" and "WEST" annihilate each other, therefore, the final result is [] (nil in Clojure)."

    But second test is
    public void Test2() {
    string[] a = new string[] {"NORTH", "WEST", "SOUTH", "EAST"};
    string[] b = new string[] {"NORTH", "WEST", "SOUTH", "EAST"};
    Assert.AreEqual(b, DirReduction.dirReduc(a));
    }

    If i understand task well, array 'b' must be empty

  • Custom User Avatar
  • Default User Avatar

    Hmmm. I may be misunderstanding how the test case errors are reported but - having re-read the instructions - it still looks to me that my solution should work. I guess it's difficult to know without being able to see the starting point for test cases that didn't pass?

  • Custom User Avatar

    These are not errors in testing, you misunderstood the task. Read through description once again, then read the posts below which mention very similar problems like the one you have.

    Your solution simplifies steps it's not allowed to.

  • Custom User Avatar

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

  • Default User Avatar
  • Default User Avatar

    I think your code remains case sensitive... where only "x" and "o" are counted and not "X" and "O".

  • Default User Avatar

    I used a similar approach, though your code is cleaner than mine. in any case, I am confused by the use of parenthese in "".join([etc.])
    Do you understand the syntax and in what instances one would use something other than parenthese?

  • Default User Avatar

    Hi Alex - perhaps using the following syntax will make a difference?: slice[x:y]