Ad
  • Custom User Avatar

    I am passing the sample test case, but failing when I attempt to solve this challenge.

    I'd suggest that a more robust sample test case is added, that factors in things like having to crop around the living cells.

    Even having the output of the attempt be a 2D array of 1's and 0's would be much better than the current html-ized version. It is needlessly cumbersome to count and type in the test arrays by hand.

    If I am missing something, do correct me.

  • Custom User Avatar

    Hints:

    • try to crack shorter passwords first (16 tests for 2-4 letter words, including the random tests)
    • find a faster way to store/retrieve the precalculated results
  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    Avanta, thanks a ton for the help. I did a complete re-write of my code, and stored key-value pairs in a dictionary that stays persistent across my for loops.

    So now, I've gotten the code to work with all my test cases. However, when I actually go for an attempt, once again codewars times out... I'm assuming the Assessment uses humongous numbers that my dictionary is having a hard time managing. I'll post my code below.

    EDIT: It runs and completes huge numbers (like 5978013048845973136) on my computer, but slowly.

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    Will do, thanks for the suggestion!

  • Custom User Avatar

    From what you've said, that sounds like it should be fast enough.

    Maybe post your code below with a spoiler tag?

  • Custom User Avatar

    I'm new to all of this. I got an algorithm working on my local machine in Python, but it constantly fails on codewars as having timed out. Does this mean I need to use some algebra tricks to make this faster?

    In it's current state, I defined a function that does the calculations to find a given pile of cubes based on a value for n. It then brute forces through every value, starting at 1. I'm guessing this is total amateur hour, but how do I go about doing this differently? Algebra?