Ad
  • Custom User Avatar

    just a mistake, it shouldn't be there (surely a left over of a previous idea while coding)

  • Custom User Avatar

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

  • Custom User Avatar

    I'll look into that. But shouldn't the test then expect an error instead of a result?

    You mentioned fixed test #38. If, for example, there was an error with a populate method that preceded test #38, then those blobs wouldn't be added to the population. But as I said, I've only taken a cursory glance so this might not be the cause of what you're encountering.

  • Custom User Avatar

    I've only taken a cursory glance, but it may have to do with invalid inputs:

    If the list input contains any invalid values, discard it entirely and throw an error (do not update/modify the instance)

  • Custom User Avatar

    .

  • Default User Avatar

    The fact that it's not solvable with straightforward recursive solution doesn't make it a performance kata.

  • Default User Avatar

    yeah.. I'm looking at how this visually works step by step and I get it (which is good) but I would have NEVER thought to do it this way. I think my brain is still thinking of things in terms of brute force methods. My method loops around in a circle over and over until all list items are used up without ever repeating. This method is like flipping a switch. "add a line, delete the line, flip a switch(move everything), reverse it and repeat."

  • Custom User Avatar

    OP's already solved the kata. Closing.

  • Custom User Avatar

    It is actually faster than your solution by a fraction of a second though

    But did you test it with big inputs, or just run it on a 10x10 array and called it a "success"? With a 400x400 array B4B's solution is 5 times faster than this one, and there're even better solutions out there.

  • Custom User Avatar

    It is actually faster than your solution by a fraction of a second though, Blind4Basics :) I have just compared them and mine wins by 100 ms or so (somewhere at 1050 vs. 1150 ms). Can you show me a solution that actually is faster than this one? I do not insist it follows the optimal algo, but I'd like to have a look at something that is efficient.

  • Custom User Avatar

    you'll reach 1 kyu. One day. If you're persistent. And on your journey there you'll realize how much this solution is actually especially "bad" (performances-wise speaking...) ;)

    • clever? -> yeah for sure.
    • best practices? -> absolutely the opposite x)
  • Custom User Avatar

    When things get difficult thats when your suppost to smile :) - zoro

  • Custom User Avatar

    It's fine. Practice makes perfect. Just keep practicing.

  • Custom User Avatar

    the 1 at the end is not necessary code completes without it.

  • Custom User Avatar
  • Loading more items...