Ad
  • Default User Avatar

    There are no test cases for C# before submission. I made my cases in Visual Studio with small, VERY large (38 characters long each), and two strings of differing lengths, and everything passed. I tried submitting, and each one of the tests here failed without telling me what the inputs were.

  • Default User Avatar

    Agreed. I found this way too straight forward.

  • Default User Avatar

    Your answer could eliminate a bunch of those variables. Keep it simpler, and easier to read. Plus, you can change your return to a single statment of just what is inside your if.

    Great idea though!

  • Default User Avatar

    A string is already a character array by definition. You don't need to cast it with ToCharArray() to use Linq operations on it.

  • Default User Avatar

    You don't need to convert your switch cases to explicit boolean values. You already have them.

  • Default User Avatar

    I'm getting an ArguementOutOfRangeException which appears to be overflowing an int, which doesn't make any sense unless it was set up incorrectly.

  • Default User Avatar

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

  • Default User Avatar

    You also need to translate the example to C#. The example in the description doesn't show up.

  • Default User Avatar

    Is there any way to get that language pulled from the list, or fixed?

  • Default User Avatar

    I've been wondering that about every Kata that I've seen on here.

  • Default User Avatar

    The square Japanese ones do.

  • Default User Avatar

    Excellent. Thanks. Kind of an odd problem, especially with it hidden away like that.

  • Default User Avatar

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

  • Default User Avatar

    As a heads up, you should store your counter.Count() in a variable to save from having to recalculate that 3 times every time through the loop. Not a huge deal in a situation like this where it's only 6 times with an array of length 5, but in larger situations that could cause a bottleneck.

  • Default User Avatar

    I tried the C# version of this, and I'm repeatedly getting an exception thrown with every one of the calls saying that the key is not found. I copied my code into Visual Studio with the dictionary being a private variable in my test class, and it ran perfectly.

    I have a feeling there's a disconnect and that dictionary needs to be made static on a class so we're able to access it from our test code.

  • Loading more items...