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.
Also had to bypass the test case. Still not fixed.
I know it's been a while since this was posed but just for future users... You do not repeat the key, you replace it with a same-size key from the plaintext.
When encrypting, you use the previous plaintext to replace the key (so in the test case, the key becomes AAAAAAAA temporarily).
When decrypting, you use the decrypted plaintext as the key (so after you solve 'AAAAAAAA' that becomes the key in the example).
You have to track the bills, not just dollar amounts. Your's would work if they only had $25 bills. Instead he specifies they either have $25 bills, $50 bills or $100 bills. No other denominations.
C# works as does Java
You probably read the question wrong as I initially did. There are only 25, 50 and 100 dollar bills (no increments or sub-types). It took 1 for-loop and several conditionals to solve it. No other data structures, recursion or functions needed.
If he made you track different payment amounts (given as nested arrays), evaluate whether or not the value was enough and then see if he could successfully get through the line (with multiple coin and dollar amounts), then it would definitely be a 5 kyu problem...
Thanks for solving. Please could you grade and rate this kata so that it passes out of beta if you havent do so yet :-)
Good suggestion thank you. I placed it into the initialize so that the code warrior could use it as they seem fit. :-)
Good suggestion and I agree with you about cheating. If you are cheating, you are only hurting yourself. You can list that you are a top-tier coder on CodeWars (are people doing this?) but when you come to interview, I will find out really quickly if you can't code...
Valid suggestion but I will be honest and say I have gone to see the results without submitting a solution on higher-level katas. I like to see how people solved something I am unable to solve myself, especially if it's not in one of my primary languages or something.
Overall pretty good. I originally thought it might be beneficial to have the characteristics as a dict in Python but I think it is good to make people negotiate nested arrays in this case.
One improvement would be putting the characteristics as a class attribute rather than in the init(). Of course, you could make it a default parameter and pass in different options, but that really wouldn't change the difficulty of it much.