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.
merged and approved
fyi ya can do (1..=n) instead (1..n + 1) to include the end of the range
This comment is hidden because it contains spoiler information about the solution
In the test cases and sample tests for Python, the parameters to
assert_equals
are being given in the wrong order. It should betest.assert_equals(is_possible(expr),expected_value)
. As it is, if the user's solution returns True when False is expected, it will sayFalse should equal True
, when it should sayTrue should equal False
.I've put togeather a JavaScript translation. Could you please review it?
(I've left description as is and translated the test cases directly.)
I wouldn't say it's bad to try and generate all combinations.
In fact there are interesting things you can do with the logic engine that generates possible solutions to an expression.