Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
You are almost there, can you find some test cases in which your code fails?
This comment is hidden because it contains spoiler information about the solution
nvm
This solution would "just traverse down". The loops uses the destination coordinates to avoid unnecessary calculations.
This can be kind of wasteful because it is computing all possible paths, including the ones which may never be required for a particular problem. It's fine on small problem sets, but consider a big grid where your destination is the first column, last row. You could arrive at the answer by just traversing down, but this solution would cover the entire grid first.
The use of reduce seems superfluous when you can simply
new Set([1,2,3,...]);
This comment is hidden because it contains spoiler information about the solution
Hi
kbirger
,how much faster?
This comment is hidden because it contains spoiler information about the solution