Ad
  • Default User Avatar

    I believe there is an issue with the card on the fixed test for Python. My code passed all the random tests, but I would get an index error on the fixed tests. I entered this at the top of my code and everything passed:

    if len(card) != 6:
        card = [['B', 'I', 'N', 'G', 'O'],
                [1, 16, 31, 46, 61],
                [3, 18, 33, 48, 63],
                [5, 20, 'FREE SPACE', 50, 65],
                [7, 22, 37, 52, 67],
                [9, 24, 39, 54, 69]]
    
  • Default User Avatar

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

  • Default User Avatar

    Question: My code (python) passes all the 100 "correctness" tests but times out during the 100 "performance" tests. I'm using numpy to count all the nxn subarrarys that have only 1's and storing the results in a dictionary. When there are less than 4 nxn arrays with only 1's, my program returns the result. I can't see how my solution can be optimized without doing some sort of mathematical approach to narrow down the subarrays that need checking. Is a mathematical approach necessary? Any suggestions would be greatly appreciated.

  • Default User Avatar

    I have the same question. If the input is the PIN number as a string, then my code should work.

  • Default User Avatar

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

  • Default User Avatar

    Thanks so much for the reply. I got it to work. The fact that someone like you would respond so quickly to someone so new at coding is why I love this community.

  • Default User Avatar

    Sorry for marking it an issue. My mistake. I reread all the description and it says to truncate my answer to 6 decimal places. I've tried using '%.6f'% and importing Decimal and all sorts of things to get the last digit to match your tests, but no matter what I do some of my answers are off by 0.000001.

    I know you're probably busy with more important things, but I would love if you could help me.

    Note, your kata's are wonderful and it feels so satisfying when I complete one correctly.

  • Default User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

    You're right. I'm an idiot. Mine was calculating the largest square numbers that 'fit' in the length x width product, ignoring the actual geometry of the situation.

    And let me reiterate: "I am pretty terrible at coding (beginner), so I definitely could be missing something here"

    sorry to waste your time

  • Default User Avatar

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