Ad
  • Default User Avatar

    I agree that it would be more sensible? fun? realistic? to take into account how much you fuel level has actually increased by the time you got home.
    But it's a 7 year old kata, it's not changing.

  • Custom User Avatar
  • Custom User Avatar

    Not rational and likely to cause headaches.

    It takes into account for total cost, the fuel you consume travelling to and from said station; This is why the original examples price is 48.75, it is the price 1.5 * the total in litres 32.5. You will be filling the original 60 - 35 = 25 litres, plus the trip to and from which are each 3.75 litres. Based on Fuel Consumption 7.5/100 * distance.

    But, it doesn't take into account total fuel you will have upon returning to your home.
    So, my original solution checked to make sure that if you LEAVE to get fuel you will return home with MORE fuel than when you left.
    Some test cases had me returning home with less fuel, why would i leave home and waste money to have less fuel.

    I understand it is for fun, but more concise explanation or description would help understand the goal of the function.
    So, it is not a practical or realistic test and should reflect better parameters in the description.

  • Default User Avatar

    Anyone have any advice on how to pass the "testRandomTrees" test case ?
    hitting error: arrays first differed at element [2]; expected:<8382> but was:<308679>

    Not sure how to go about it. Or if anyone had similar issues.