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.
We can add this at the first line: if (Object.keys(recipe).length === 0) return 0;
It will save us from empty recipe.
In the rest this solution seems to be the best practice.
All the logic that I have made for solving the problem too, but written laconically in one line, I really like this style.
neat!
the clearest and the shortest write
Say hi to olg good Gauss))
This comment is hidden because it contains spoiler information about the solution