Ad
  • Custom User Avatar

    Amazing, it's just perfect. I know specially the test cases are not giving a proper feedback to the user but I had a bit of a bad time trying to figure out how to make it work. Thank you very much for the translations again!!

  • Custom User Avatar

    Thank you so much for the translation Giacomo! They are approved already. I would like to have random test cases for the JS version too :D

  • Custom User Avatar

    Amazing, thanks! :)

  • Custom User Avatar

    Perfect. I didn't knew about the +. Now every value with decimals that you return has to be rounded to 2 decimals. Give it another try!

  • Custom User Avatar

    You're totally right! Actually I tried before to use rounded decimals, the problem is that I could only think of using toFixed(2), but it is giving back a string, and even using parseInt() on it, for some strange reason, the system didn't recognize the number even though it was the same: after trying that the system was saying (as an example) Expected: 4444, instead got: 4444.

    Anyway, I'll try to think of a different easy way of rounding, I think people don't need to write a whole rounding function.

  • Custom User Avatar

    Done! I did some fixes and I added one test case for the second function! Enjoy!

  • Custom User Avatar

    Sorry about that! I updated the consumption on the description to be l/100km and changed the function according to that and I also fixed the typo!

    Thanks for the feedback!

    Also note that the second function has been updated as it had a bug. Before it was already taking out petrol even when you where on 0 km (now petrol on 0 km driven should be the original)

  • Custom User Avatar

    Sorry about that! I updated the consumption on the description to be l/100km and changed the function according to that.

    Thanks for the feedback!

    Also note that the second function has been updated as it had a bug. Before it was already taking out petrol even when you where on 0 km (now petrol on 0 km driven should be the original)

  • Custom User Avatar

    Polish a bit the description and I think it's ready to go!