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.
Lua translation!
Haskell translation
Nice Kata, but.... in the description the line "If you have less than 2 boxes at any side, you will run out of boxes while carrying." is confusing, as it relates to the EXAMPLE and not to the general problem.
Very confusing, especially because the line is highlighted bold.
Took me som time to figure that out...
Special test cases suggestion:
Hi,
The description needs at least a reorganization:
cheers
Author solution cannot actually solve this kata either: for example, it can solve
easily, but barely passes
, and is absolutely hopeless at
or
. All of these have a valid path of length 34 (so they should return
True
).None of the current submitted solutions can solve the actual task for all the possible inputs: every solution except author solution times out even when just changing the random tests to run the 4 fixed tests in random order for 100 times.
Basically, random tests are very weak: they have very few possible "valid" paths because all pathways are very narrow, so a DFS solves all the random tests very quickly. It does time out on the fixed tests, but fixed tests are, well, fixed, and there are other ways to work around them too, like giving up after trying for a while.
This comment is hidden because it contains spoiler information about the solution
Seems ready to approve - do you want to change something more?
This comment is hidden because it contains spoiler information about the solution
Not a bad one. I think the example walkthrough can be way more clear. Like even after solving it, I'm still not sure how starting with the solution (2,2) aids in understanding. I had to just go through the other examples and write it out to figure out my solution. Maybe something like: So for example, lets say you have lst = [1,2,3,4]. Think of the first 2 indices as the start of the left and right side. So starting from left to right, we have 1 box (lst[0]) on the left going to the right (lst[1]). So now we have (0, 3) where 0 is the left and 3 is the right. Now it's time to go from right to left. The next amount of boxes to move comes from index lst[1] since we are now going through each move operation in lst. So now we are moving 2 (lst[1]) from the right side, 3, to the left side, 0. So we get (2, 1). Find the amount of additional boxes needed if the current amount of required boxes lst[i] operation (left or right movement) is short for the current side.
Interesting kata. I suggest you turn this into a performance kata for extra challenge.
I would strongly suggest having a one character function name. Every additional character comes off the code size limit, so the limit could be 30 instead of 40 without changing the difficulty of the task. The golfing task ( generous as 40 is! ) is not a 40, it's a 30.