Ad
  • Default User Avatar

    For sure a nice Kata, but yes the 4 test case is bugged.
    Get the same exception for testing purpose did catch the NullReferenceException, saying values differ at index 0,1.

  • Default User Avatar

    there is an issue with c#.
    We should had this test
    int[] peopleInLine = new int[] { 25, 25, 50, 50, 50 }; This should give "NO".
    But there is solutions, tagged as best pratice and clever that answer "YES" to this test case and still pass the official test that validate their solution.

  • Default User Avatar

    As UKS notice, this solution should not pass.
    If you use the following entry :
    int[] peopleInLine = new int[] { 25, 25, 50, 50, 50 };

    The correct answer is "NO". When the last person want to pay; we only have 50$ bill; so we are unable to give back 25$
    But, when you launch this code; it will answer "YES".

    I check this code with the submite button. It really success in passing the test.
    I think; it lack some test that will show that this code is failling.

  • Custom User Avatar

    Please consider completing the code within one function, do not call recursive.

    This is the only reason that I can think of.

  • Default User Avatar

    For unknown reasons, when I add you code; mycode is validate with 3 successfull test.
    But, without you code; I pass 8 out of 9 tests.

    Some side effect of your code is that, now, we only pass the 3 firsts test. The forth one(the one failling with my code) is not executed.

    Your comment confirm that the test for this excercise are bugged.

  • Default User Avatar

    I've got the same exception on that test case. To get a better understanding of the problem I added the following to the beginning of my solution to simply print the array on screen.

    int XX = array.GetLength(0);
    int YY = array.GetLength(1);          
              
    for (int i = 0; i<XX; i++)
    {
    for (int j = 0; j<YY; j++)
     Console.Write(array[i,j]);           
    } Console.WriteLine("------");
    

    For unknown reasons I pass every test with those lines added, while removing them results in the NullReferenceException.

  • Default User Avatar

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

  • Custom User Avatar

    paste your code here and mark it as having spoiler content.

  • Custom User Avatar

    My code works fine, perhaps your code has some problems ;-)

  • Default User Avatar

    I've got this error when I submit.
    But it doesn't seems to come from my code.

    TestLargeRandom
    SetUp : System.NullReferenceException : Object reference not set to an instance of an object
    at NUnit.Core.NUnitFramework.GetResultState (System.Exception ex) <0x42051050 + 0x0004c> in :0
    at NUnit.Core.TestMethod.RunTest () <0x42047ea0 + 0x0014d> in :0

    Is it a problem with the test runner? Or do you think there is something in my code that can trigger this message?