Skip to content

Commit

Permalink
Merge commit 'd1a92281842c99164515e142bae72734b1675375' into samdebacker
Browse files Browse the repository at this point in the history
  • Loading branch information
ireactsam committed Dec 3, 2014
2 parents 42b0574 + d1a9228 commit fd9c764
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 1 deletion.
Binary file modified lib/project-euler-answers-scala_2.11-1.0-SNAPSHOT.jar
Binary file not shown.
Binary file added slides/Scala Intro - Euler.pdf
Binary file not shown.
1 change: 1 addition & 0 deletions src/test/scala/org/bescala/projecteuler/Euler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class Euler extends Spec {
new Problem000,
new Problem001,
new Problem003,
new Problem004,
new Problem005,
new Problem006,
new Problem007,
Expand Down
2 changes: 1 addition & 1 deletion src/test/scala/org/bescala/projecteuler/EulerSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class EulerSuite extends FunSuite {
info(s" $line")
}
info("------------------------------------------------------")
info("")
info(alternative)
val t0 = System.nanoTime()
val result = solution
val t1 = System.nanoTime()
Expand Down
30 changes: 30 additions & 0 deletions src/test/scala/org/bescala/projecteuler/problems/Problem004.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package org.bescala.projecteuler.problems


import org.bescala.projecteuler.EulerSuite
import org.bescala.projecteuler.ProjectEuler._

class Problem004 extends EulerSuite {

/**
* A palindromic number reads the same both ways. The largest palindrome made from the product
* of two 2-digit numbers is 9009 = 91 x 99.
*
* Task: Find the largest palindrome made from the product of two 3-digit numbers.
*
* Note: The stated problem can be solved for numbers with a larger number of digits.
*
* For example, for 5 digit numbers, the largest palindrome is 9966006699 = 99681 * 99979 and
* this solution can be determined programmatically in under a second.
*
* In fact, it is possible to calculate the value of these palindrome for the product of two
* numbers up-to 8 digits in around 5 seconds.
*
* Finding the right strategy for finding a fast solution is not straightforward. Use experiments to
*find a good strategy. The 'fast' solution doesn't require tons of math...
*
*/
euler(problem(4)) {
TODO
}
}

0 comments on commit fd9c764

Please sign in to comment.