Skip to content

Instantly share code, notes, and snippets.

@zerosum
Created January 23, 2013 12:08
Show Gist options
  • Select an option

  • Save zerosum/4604885 to your computer and use it in GitHub Desktop.

Select an option

Save zerosum/4604885 to your computer and use it in GitHub Desktop.
Project Euler: Problem 15
package euler.zerosum
object Euler0015 {
def main(args: Array[String]) {
val width = args(0).toInt
val height = args(1).toInt
val numer = width + 1 to width + height
val denom = 1 to height
println(
numer.map(scala.math.BigInt(_)).product / denom.map(scala.math.BigInt(_)).product
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment