Ad
  • Custom User Avatar

    onlyonekenobie,

    Hey first: nice name, haha. Second: I had this same error for a while, and figured out that a value was indeed duplicating. It must be that two sequences or something add up to this specific value or something, not entirely sure, but my fix was to check for duplicates, and just removed the duplicate then I had an accurate count.

    Hopefully this helps!

  • Default User Avatar

    Did you ever come right with this? I have a similar issue in that I have more palindromes for very large numbers than are expected. I've checked, and don't see any duplicates

  • Custom User Avatar

    Test results are correct - im guessing same number has been counted twice.

  • Default User Avatar

    Check your code. If you can pass the example tests, you should be able to pass the random tests. See B4B's messege below, admitting that this was a toughy for him and he's 1kyu. So please take your time.

  • Default User Avatar

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

  • Default User Avatar

    Good point. The one-liner "best practice" might be sub-optimal in terms of asymptotic complexity. I think yours is O(n): O(n) (for split) + O(n) for the explicit loop. So the whole thing is still O(n). But the one-liner might be O(n**2) given the way min() is used.