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.
Hello!
Thank you so much, you are right. Strength represents the weight the web can hold, so the description is wrong. I have updated it, thank you so much for your detailed explanation
There seems to be an issue either in the description or in the 3rd test. The description says that strength represents the weight that breaks the web and the task asks us to calculate how many elephants can be placed without breaking the web, so total weight of elephants should be smaller than the strength of the web.
However, test case 3 expects a web with strength 532000 and width 532 to be able to hold 532 elephants. This means that 532 elephants on the first row, weighing 1000kg each, for a total of 532000kg would not break the web with strength 532000. Since 532000kg is explicitly stated as the weight that breaks the web, the expected answer seems to be wrong.
It would be better to either make it clear in the description that the web will still hold the weight exactly equal to its strength or change the expected output of the third test to 531 elephants.
Seriously ?! 7kyu ?
Re-ranked to 7 kyu
It's harder if you're not good with binary.
Known since long but too many guys passed the kata so it is impossible to correct it and re-publish;-( You should have read a few posts below. Sorry!
Badly written Java tests
In tests, asserts are written the wrong way round, making failing test messages very confusing.
The first value you should put into your assertEquals() is the correct value you are expecting and the second one sould be the result of the actual expression. That way if the test fails, you get a message saying "Expected "CorrectValue", got "WrongValue"". In this kata the values are switched around so when the test fails, the message says "Expected "WrongValue", got "CorrectValue"" which is very confusing.
I sugget rearranging the assertEquals arguments to make this katas' failing test messages more useful and less confusing.
This comment is hidden because it contains spoiler information about the solution
Too easy for kyu 5, should be 6 or even 7