Ad
  • Custom User Avatar

    That's what I was missing, the keyword within. Thanks a lot, I am going to go over my code now!

  • Custom User Avatar

    a 1 if an interesting number occurs within the next two miles

    Adding 1 to 110, gives you 111 whichs is an IN
    Adding 1 to 799999, gives you 800000 which is an IN

    Within means you could add 1 or 2 to reach an IN.

  • Custom User Avatar

    Thanks for the reply. Now I am clear on the incrementing and decrementing part. However, I am still unsure about how the numbers 110 and 799999 should return 1. When adding 2 to both of them, you get 112, and 800001, which as far as I am concerned, are not interesting numbers. What am I missing? Thanks!

  • Custom User Avatar

    are 122, 112 or 800001 interesting numbers?

    No, unless they're in the awesomePhrases array.

    About sequential, have you read the description? 123, 456, 1234 are sequential incrementing (the next digit is the previous one plus 1) or 4321, 876, 210 are sequential decrementing (the next digit is the previous one minus 1)

  • Custom User Avatar

    My code fails with the incrementing and decrementing sequential sequences. However, this is because I don't udnerstand what the problem means by sequential. For example, why are 122, 112 or 800001 interesting numbers?

  • Custom User Avatar

    @daimonji, I had the same thought but did not know how to implement it. In your code, 'if poss[c]' is always False as both values in poss are equal to 0. Can you explain?

  • Custom User Avatar

    @Haksell, correct.

  • Custom User Avatar

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

  • Default User Avatar

    I like this one the best, it's by far the clearest one.