Over the past couple of years I keep on coming back to Project Euler, it’s nice when you just want a quick challenge, or to try your maths skills. It’s highlighted how rusty some of my concepts were, and I’ve learnt a whole load of new ones along the way. I really like the way that the example problem given is quite quick to determine using brute force, but the desired answer always needs a . . .
I’m trying to start up on project Euler again, one thing I do like is that it highlights how poor some of my maths knowledge actually is. Neither school or college covered many of these algorithms; which is a bit of a surprise given that I did a four-year mechanical apprenticeship with applied mathematics…..still never too late to learn So I (re)started on problem 24 which read: A permutation is an ordered arrangement of objects. . . .
The challenge set by problem 18 was By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23. 3 7 4 2 4 6 8 5 9 3 That is, 3 + 7 + 4 + 9 = 23. A 15-row triangle was then supplied for which the program must determine the corresponding maximum value taking a similar path . . .
The challenge set by Problem 54 was to determine the number poker games payer 1 won given a text file detailing 1,000 hands dealt to 2 players. Given the logical nature of the rules, the solution was just a case of finding the best way to 1) implement the rules and 2) duplicate the rule hierarchy. I quickly re-factored my first attempt that attempted to place the ruled based logic inside of the PokerHand class . . .