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.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Length property is not calculated.
No need to cache Length of an array;
This comment is hidden because it contains spoiler information about the solution
too many calculations of numbers.Length. better to assigh it's value to a local variable
Try to play back the sequence you posted using real tokens (coins, pieces of paper simulating notes etc.). You will find your mistake.
can you help ?
smart 🤣🤣
Do the maths once again :-)
Nice kata though I would prefer if it came with boolean return value and a better title.
No, because you're not thinking on bills, you have 100 dollars, yes, but 2 50 dollars bills, how do you give 75 back like that?
This precondiotion is completely wrong:
Line.Tickets(new int[] { 25, 25, 50, 50, 100 }) // => NO. Vasya will not have the right bills to give 75 dollars of change (you can't make two bills of 25 from one of 50)
Explanation:
Obviously if You have 100 dollars, you can sell the last ticket