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.
No help here?
@AWTom Great, the solution has readability and efficacy.
I wrote a very similar solution with much more readable variable names. The biggest differences are that mine uses a slice instead of the first for loop, and reads the length values inside of the main loop rather than assigning a new array for them.
https://www.codewars.com/kata/reviews/56a5db17af136c8210000058/groups/635a0ade4e920a000183011d/
I had to go as far as your comment to understand the exercise. I completely agree with you both: it would be good to clarify the statement.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I'm trying to avoid that temptation, but I've been searching for hours on how to call an anonymous class within an anonymous class and the kata doesn't seem to accept any of the solutions I've tried.
Not sure if you've figured it out in the meantime, but since this comment thread helped me get the right answer I figured I should return the favor:
Where does wallpaper go?
It is a question, not an issue. You could have had a look at the top of the page to see how many guys passed the PHP kata.
Print the input to see what is expected.
If your calculations were correct you should have
15.71..
and15.57
sosixteen
is correct in both cases. These tests are the same in all languages and if there were errors somebody will have already mention them.Would you really cover all of
2 (length x width + width x height + height x length)
with wallpaper?This comment is hidden because it contains spoiler information about the solution
That means you need another approach ;-)
You can't serialize anonymous class in PHP, it's by design(?):
https://stackoverflow.com/questions/13734224/exception-serialization-of-closure-is-not-allowed/