Ad
  • Default User Avatar
  • Custom User Avatar
  • Custom User Avatar

    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...

  • Custom User Avatar

    Special test cases suggestion:

    test_cases = [int("".join(str(1 - j % 2) for j in range(i)), 2) for i in range(1, 32)] +\
                 [int("".join(str(1 - j % 2) for j in range(i)), 2) + .5 for i in range(2, 32, 2)]
    
  • Custom User Avatar

    Hi,

    The description needs at least a reorganization:

    • the rules must be given way earlier (and before the task part)
    • the description talks about average everywhere, but never clearly says between what values (might be I missed it, tho) => from what I understood, it's the average, for one specific string, where x is 0 with the same string where x is 1. => must be clarified (in "task point 2", for example).
    • the background section is currently totally useless. It can be summarized as "hey, there are some info but just go somewhere else to get them" => either the relevant parts are in the description and the section is useless, or they aren't and they should be added (and then, the section becomes useless)

    cheers

  • Custom User Avatar

    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).

  • Custom User Avatar

    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.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar
    • the description could use rewording. there are some grammar errors and the story/years relation is kinda pointless
    • the characters can be spaced out some more so that it is easier to copy and paste it into the code and so that it is easier to tell the difference between chars for non-chinese speakers
  • Custom User Avatar

    Seems ready to approve - do you want to change something more?

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    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.

  • Custom User Avatar

    Interesting kata. I suggest you turn this into a performance kata for extra challenge.

  • Custom User Avatar

    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.