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
  • 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

    [0, 1, 2, 3, 2, 0] should equal [0, 1, 2, 3, 6, 5, 3, 2, 0] <-- This is message about failed test #5

    ((), (), (4, 4, 4, 4), (), (2, 2, 2, 2), (), ()) , 2 <-- These are inputs in test #6

    You mix up the messages, and wrongly assume what refers to which test. Anyway, everything is okay with the kata, the problem is in your solution.

  • Custom User Avatar

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

  • Custom User Avatar

    Are you sure you printed the inputs correctly?

  • 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

    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
    
  • Custom User Avatar

    In terms of this kata, a system can be solved if each variable corresponds to some value you CAN find.

     x  y |           x  y |
    ------+---  -->  ------+---  --> Either X or Y is an unknown parameter and the other variable depends on this parameter.
     1  2 | 1         1  2 | 1
     2  4 | 2         0  0 | 0