Ad
  • Custom User Avatar
  • Custom User Avatar

    Dude next time please look at your code for just one second...
    This if else thing is just horrible. You could've just checked if it is not divisible by 2 and then append _ . There is no need for coding the same loop twice

  • Custom User Avatar

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

  • Custom User Avatar
  • Custom User Avatar

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

  • Custom User Avatar

    Just a waste of resources. Use a simple loop and 2 variables and you get O(n) time and O(1) space...

  • Custom User Avatar

    This is definitely not a best practice...

    It looks handy and short but that's it.

  • Custom User Avatar

    @hobovsky Your comment is actually a little bit misleading. You need to calculate n! because it's not possible to rewrite the formula so it doesn't contain n!.
    What you can do is rewrite the formula in a way you can calculate the result more efficiently but you always have to calculate n!

  • Custom User Avatar

    As many top 'coding craftsman' already said, when your variable needs an explaining comment you did something wrong

  • Custom User Avatar

    just another case of linq abuse...

  • Custom User Avatar

    Ok I'm sorry about that one. One of the LINQ statements I used was responsible for the weird error messages. So definitely my own error.

  • Custom User Avatar

    I'm not trying to say that it's not possible to pass the tests (even if I dont agree with your point of view that nwse isn't equal to []).
    So sure there's something wrong with my algorithm.
    But still the error messages are incorrect.
    Again how can both be string[2] when expected string length is 5 and actual is 4?

  • Custom User Avatar

    C# test cases seem to be broken.
    Given: {"North", "East", "West", "South"}, Expecting {"North", "East", "West", "South"}
    But when walking north, then east, then west, and finally south I'm right where I was at the beginning so correct output should be an empty array

    Also I get quite weird error messages like:

    Expected and actual are both <System.String[2]>
    Values differ at index [0]
    Expected string length 5 but was 4. Strings differ at index 0.
    Expected: "NORTH"
    But was: "EAST"
    -----------^

    How can both be string[2] when expected string length is 5 and actual is 4?

  • Custom User Avatar

    C# test cases dont work. My function works perfectly but the tests are telling me that the passed in string is wrong formatted.

  • Custom User Avatar

    C# test cases are broken. For rgb(255, 255, 255) it says my algortihm returns FFFF2C but testing it on my own my algorithm returns FFFFFF.

  • Loading more items...