Darth Paradox (darthparadox) wrote,
Darth Paradox
darthparadox

Whoops.

So, Problem 8 in Project Euler gives us a 1000-digit number, and asks us to find the largest product of five consecutive digits inside the number. I work out the math, realize that the brute-force approach starting from lists of consecutive integers would require somewhere in the range of 10^200 comparisons to verify a maximum, and start looking for a better way. I find one, then fail at implementing it.

Then I'm talking to Matt, and he points out the problem says "consecutive digits", not integers. Like, digits inside the number. As in 996 computations for the brute-force method instead of 10^200, and working with numbers with five or six digits instead of hundreds or a thousand.

I'm fantastic at math, and a pretty damn good programmer. But apparently reading comprehension is one of my weak points.
Subscribe
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 14 comments