Ad
  • Custom User Avatar

    The point is there are infinite number of solutions.
    Each pair x, y that satisfy equation is valid solution:

    x = 1 - 2y
    

    Example solutions:
    x = 1, y = 0
    x = 0, y = 0.5

    Such system equations is called indeterminate. In that case you should return 'None'

  • Custom User Avatar

    Thanks again for fixing the log.
    I SOLVED this kata and it was immensely satisfying.
    Definitely was harder than I initially envisioned.
    You are right, I now respect elevators :)

  • Custom User Avatar

    Yes, thank you. It seems correct now.
    Thanks!

  • Custom User Avatar
  • Custom User Avatar

    FArekkusu is right, the log is matching the next test. The line announcing the test is just after the call to your function. Old translation of mine... I'll correct that (tho, the weirdest part in the story is that it bahaves the exact same way the last time you tried! ;) )

  • Custom User Avatar

    I guess I am confused. Not sure if you are saying I am printing the wrong input to the expected output.
    I was saying that something changed as The tests were generating seeming correct expected output.
    Now you can see in the above example that the expected output shows that the elevator stops at floor 6.
    there are no passengers there.

  • Custom User Avatar

    errrr.... and? The "log" is the input you printed out from inside your code. Nothing weird, here.

  • Custom User Avatar

    Here is a copy and paste:
    Up and down
    [0, 1, 2, 3, 2, 0] should equal [0, 1, 2, 3, 6, 5, 3, 2, 0]
    Log
    ((), (), (4, 4, 4, 4), (), (2, 2, 2, 2), (), ()) , 2

  • Custom User Avatar

    Are you sure you printed the inputs correctly?

  • Custom User Avatar

    Did something just change?
    It appears something is broken in the tests.
    For example, for queue: ((3, 3, 3, 3, 3, 3), (), (), (), (), (4, 4, 4, 4, 4, 4), ()) , 5
    It says, should equal [0, 1, 2, 3, 6, 5, 3, 2, 0]

    Another example: ((3, 3, 3, 3, 3, 3), (), (), (), (), (4, 4, 4, 4, 4, 4), ()) , 5
    Says, should equal [0, 3, 5, 4, 0, 3, 5, 4, 0]

    I am using Python 3.6

    It seems I saw that reported correctly 1 day ago.

  • Custom User Avatar

    It turned out that I had a bug in the parsing code and my algorithm correctly detected the rank of the matrix.

  • Custom User Avatar

    I appreciate the non-insulting parts of the explanation and thank you for taking the time to answer.
    Evidently the gauss-jordan algorithm I used did not detect a problem as it returned a properly row reduced matrix.
    1 0 | 1
    0 1 | 0

    I wiil check that.
    Thanks.

  • Custom User Avatar

    Okay, if you don't understand how math works, then I'm of no help to you. Good luck.

  • Custom User Avatar

    You lost the bet!
    Next time don't bet. I cannot imagine anyone who appreciates such comment.

    If the kata said that no varaible can be zero, then it would be clear.

  • Custom User Avatar

    I bet you haven't studied linear algebra. What you have "found" is a parameter which can be any real number:

    x + 2y = 1
    
      x =  |  y =   | result
    -------+--------+--------
      ...  |  ...   |   1
      1-2n |   n    |   1
      ...  |  ...   |   1
      -3   |   2    |   1
      -2   |  1.5   |   1
      -1   |   1    |   1
       0   |  0.5   |   1
       1   |   0    |   1
       2   | -0.5   |   1
       3   |  -1    |   1
      ...  |  ...   |   1
       m   |0.5(1-m)|   1
      ...  |  ...   |   1
    
  • Loading more items...