Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
classic off by one error... you need to say pop < p not pop <= p and you must floor each iteration
Not nearly as elegant, however
I am getting the same. Expected 50, Got: 51
Any clues on this? Is this a faulty test case. I am using Java.
Update -- Solved, it was my wrong.
Are you the only one who goes againt the result of 6156 guys? I can only repeat what I said: your method is wrong.
I agree with
2 + 2 = 4
because the calculation is correct but that doesn't mean that it is a good result for a test of the kata.I don't want to be rude (and if you think that I am, I will be very sorry).
If you want you could unlock the JS solution and look at right solutions.
Cheers!
I have made the solution which pass all tests except this one, because this one is incorrect!
If you agree with my calculation, how can you deny that the test is invalid?
Link above proves that 150 is correct answer for given set of input data (1500000, 0.25, -1000, 2000000), isn't it?
p.s. We can discuss this in private messages if you are worried about spoilers :)
Yes your calculation is certainly correct but it is not the good way to get the result... I can't give the solution:-)
I'm sorry, but can you explan me the fact, that even wolframalpha considers just as I, just check it:
https://www.wolframalpha.com/input/?i=((1.0025)%5E150)*1500000+%2B+(-1000*150)
The result is stiil greather than 2000000 :)
I am very sorry, look at the top of the page: 1754 guys passed the JS kata, 6145 with all languages. The tests are the same in all the 13 languages. For all these reasons there can't be any error in the tests. Don't forget that decimal part of a population don't have babies:-)
One of basis tests:
Test.assertEquals(nbYear(1500000, 0.25, -1000, 2000000), 151);
But it should be:
Test.assertEquals(nbYear(1500000, 0.25, -1000, 2000000), 150);
just check out this js expression:
This comment is hidden because it contains spoiler information about the solution
Passed 105, Failed 1.
Expected: 50, instead got: 51
Can anyone please shred some light here.
This comment is hidden because it contains spoiler information about the solution