We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 001fcba commit db38314Copy full SHA for db38314
Project-Euler/Problem015.js
@@ -0,0 +1,13 @@
1
+// https://projecteuler.net/problem=15
2
+/* Starting in the top left corner of a 2×2 grid, and only being able to move to
3
+the right and down, there are exactly 6 routes to the bottom right corner.
4
+How many such routes are there through a 20×20 grid?
5
+*/
6
+
7
+const latticePath = n => {
8
9
+ for (var i = 1, c = 1; i <= n; i++)
10
+ c = c * (n + i) / i;
11
+ return c;
12
+}
13
+console.log(latticePath(20));
0 commit comments