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.
thanks a lot!
it would be great to have typed functions to make much easier to understand the conditions of the kata.
I would be happy to updated them if that's possible.
Although not explicitly stated, the sample tests indicate that the price isn't always an integer, so your calculation might be wrong, and also you type hint the input (see what happened when in not strict mode?).
Closing as this is not an issue with the tests.
Am I making something wrong? or the random test for PHP is faulty?
it says for example, that with a bonus of 703 and a price of 1,I should only be able to make 11 floors,
when 12 full floors would require 650 cans
or with a bonus: 739 and price: 5 (147 buyable beers) it can only make 6 floors, when 7 requires 140 cans
or with a bonus: 720 and price: 5 (144 buyable beers) it can only make 6 floors, when 7 requires 140 cans
or with a bonus: 876 and price: 2 (438 buyable beers) it can only make 9 floors, when 10 requires 385 cans
I understood why the truth was expected: -14*-14 = 196
But my solution was to first find the root of the number Math.sqrt(196); then find it in array A
Maybe I'm not the only one who solved the task in reverse order๐๐
Test8: not sure if this is the right test
log
[0, -14, 191, 161, 19, 144, 195, 1]
[1, 0, 196, 36481, 25921, 361, 20736, 38025]
expected: true but was: false
why expected true?
oh my I totally missed it, thanks!
That's not the test you're failing. You have a flawed first
if
condition, and return an incorrect value, so you don't even print the array of actual failing test. Try moving yourif
condition afterprint_r
.Make sure to read the last line of description carefully.
null
isn't the same as empty array.The issue is in your code, not the kata itself.
Seems like the test cases for PHP are faulty:
I'm getting and error with the following test case:
array 1
squared and counted array 1
array 2
squared and counted array 2
invalid
Failed asserting that false is identical to true.