Skip to content

Commit 22fcd2d

Browse files
code formatted using standard.js
1 parent b941672 commit 22fcd2d

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

Project-Euler/Problem015.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ the right and down, there are exactly 6 routes to the bottom right corner.
44
How many such routes are there through a 20×20 grid?
55
*/
66

7-
//A lattice path is composed of horizontal and vertical lines that pass through lattice points.
7+
// A lattice path is composed of horizontal and vertical lines that pass through lattice points.
88

99
const latticePath = (gridSize) => {
10-
11-
for (var i = 1, paths = 1; i <= gridSize; i++)
12-
//The total number of paths can be found using the binomial coefficient (b+a)/a.
13-
paths = paths * (gridSize + i) / i;
14-
return paths;
10+
for (var i = 1, paths = 1; i <= gridSize; i++)
11+
// The total number of paths can be found using the binomial coefficient (b+a)/a.
12+
{ paths = paths * (gridSize + i) / i }
13+
return paths
1514
}
16-
console.log(latticePath(20)); //output = 137846528820
15+
console.log(latticePath(20)) // output = 137846528820

0 commit comments

Comments
 (0)