Ad
  • Custom User Avatar
    • [2, 0] or [0, 2] means one side of the package has a good apple, and the other side is bad.
    • [0, 0] means both sides of the package are bad, indicating a fully rotten package.
  • Custom User Avatar

    The "out of range" error is likely caused by accessing indices in an empty list or an incorrectly handled case when dealing with partial or empty crates.

  • Custom User Avatar
  • Custom User Avatar
  • Custom User Avatar
    A fruit package with one bad apple, or a bad package, is represented with [2,0] or [0,2]
    
    A fruit package with two bad apples, or a rotten package, is represented with [0,0]
    
    

    What do they mean by this?

  • Custom User Avatar

    As mentioned by B4B below, this is not well explained (Also note how fruits in a package are ordered when repacking. Example shown in INPUT/OUPUT above.)

  • Custom User Avatar
  • Custom User Avatar

    Python 3.8 should be enabled.

  • Custom User Avatar

    You should have let this issue opened, the process to eliminate boxes on the run is really unclear.

  • Custom User Avatar

    i got it right except... my code can't hande empty boxes. i get "out of range" msg.
    any ideas?

  • Custom User Avatar

    Well, you should raise a question instead in this case. Otherwise we're confused too ;-)

  • Custom User Avatar

    Hi,

    I didn't mean to imply that there was something wrong with the kata. I was just confused by the random tests. Thanks for the tip about printing the input to the console.

  • Custom User Avatar

    Hi,

    First, this is not an issue, this is a question. "Obviously", since 97 people already completed the kata in JS, it's a problem in your code, not in the kata (issues are for the latter case).

    About your question, so: yes, there are random tests that your code has to pass. That means your code doesn't handle properly some edge case that appears in the random tests only. You should print the input to the console to debug your code.

  • Custom User Avatar

    Okay, this is strange. I am getting a type error for an undefined object property but each time I run the attempt I pass a different number tests, even without changing the code. Doesn't it always run the same tests? How can I be passing 20 tests in some runs and 0 in others with the same code?

    I also can't debug the type-erros since I am not being shown the input that produces it. It passes all the sample tests plus more sample inputs I came up with. I can't see why it would produce the type error.

    Any suggestions?

  • Custom User Avatar

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

  • Loading more items...