diff --git a/src/Julia/Problem015.jl b/src/Julia/Problem015.jl new file mode 100644 index 0000000..d556a9d --- /dev/null +++ b/src/Julia/Problem015.jl @@ -0,0 +1,28 @@ +using Base: Integer +#= +Created on 25 Jul 2021 + +@author: David Doblas Jiménez +@email: daviddoji@pm.me + +Solution for Problem 15 of Project Euler +https://projecteuler.net/problem=15 +=# + +function Problem15() + #= + Starting in the top left corner of a 2×2 grid, and only being able to + move to the right and down, there are exactly 6 routes to the bottom + right corner. + + How many such routes are there through a 20×20 grid? + =# + n = 20 + return Integer(factorial(big(2n)) / (factorial(big(n)) * factorial(big(2n - n)))) +end + + +println("Time to evaluate Problem 15:") +@time Problem15() +println("") +println("Result for Problem 15: ", Problem15())