So in progressing through
Project Euler it is becoming more and more apparent that with slightly better math skills, I could be much more efficient at this. For example, my solution to
Problem 9. While the code itself may not look all that messy, this is probably the WORST way to solve this one. My computer is not very happy with me at the moment, but I got the right answer damnit! But this just goes to show you, you can get the right answer the wrong way. In this case I was trying to find the ONE Pythagorean Triplet (a < b < c where a*a + b*b = c*c) that sums to 1000. With my solution I had it running through !3000 (3000 Factorial) iterations, or, more accurately,
this lovely 9,131 digit number. I've gotta get better at this stuff.
No comments:
Post a Comment