Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add solution for Project-Euler Problem15 #631

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
raklaptudirm merged 4 commits into TheAlgorithms:master from black-tmin-oil:master
Jul 7, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Project-Euler/Problem015.js
View file Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// https://projecteuler.net/problem=15
/* Starting in the top left corner of a ×ばつ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 grid?
*/

const latticePath = n => {

for (var i = 1, c = 1; i <= n; i++)
Copy link
Member

@raklaptudirm raklaptudirm Jul 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add an explanation for your code as comments. The repository is focused on educating people, so it is important that everyone can understand all the code. Refer to #630 for comment format.

c = c * (n + i) / i;
return c;
}
console.log(latticePath(20));

AltStyle によって変換されたページ (->オリジナル) /