Skip to content

Instantly share code, notes, and snippets.

@iJustErikk
Created December 4, 2020 18:53
Show Gist options
  • Save iJustErikk/21fbc484c9eff9d8278a0012e79f58c0 to your computer and use it in GitHub Desktop.
Save iJustErikk/21fbc484c9eff9d8278a0012e79f58c0 to your computer and use it in GitHub Desktop.
const gridTraveler = (m, n) => {
if (m === 0 || n === 0) return 0;
if (m === 1 && n === 1) return 1;
return gridTraveler(m - 1, n) + gridTraveler(m, n - 1);
};
console.log(gridTraveler(15, 15));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment