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.
In addition to what @Dec0y-jb said, It's also takes advantage of what PHP considers "truthy" and "falsey". To learn more about what PHP considers "true", see the truth table in the documentation.
http://php.net/manual/en/types.comparisons.php
Here, the code
array_sum($a) % 2
returns an integer number. If it returns any number other than 0, the ternary operator sees it as a "true" condition, thereby returning the first value. However, if it returns exactly 0, the ternary operator sees it as a "false" condition, returning the second value.The sort flag is optional, but defaults to SORT_REGULAR
Yes, pretty sure that is a rounding problem. Try to change the order of the multiplication and the division.
I'm tring to figure out the point of your comment.
Are you trying to boast that your a better programmer than me, that's very likely, this is only a hobby for me, I'm likely a better forklift driver than you.
Are you trying to say that I didn't need to post this comment, if so, I hope you understand the irony of posting a pointless comment to point out a pointless comment.
Or are you just trying to push points about things I already knew?
I've never understood these ternery operators :/
This comment is hidden because it contains spoiler information about the solution
I have a same problem with JS,I just stuck on the case :Test.assert_equals(michael_pays(5), 3.33). Can you please fix it?
Im stucked with my solution. It currently passes all the tests except 1 or 2 depending on the random tests. My solution and the expected one only differs in the second decimal digit (i.e 10.02 expecting 10.03). Could it be because of round function?
This comment is hidden because it contains spoiler information about the solution