Ad
  • Custom User Avatar

    @Pankwood, @thanhdoan
    Problem here is not a O()
    Problem here is an IEnumerable in C#.
    Possible, it can be infinite.
    You can try it with simple method: https://gist.github.com/IDontKnower/5df0a1a5d957ec37f719674eafeeacf4
    I think, in my example it's realy hard to get GroupBy or Sort)

  • 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