Ad
  • Default User Avatar

    Also had to bypass the test case. Still not fixed.

  • Default User Avatar

    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).

  • Default User Avatar

    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.

  • Default User Avatar

    C# works as does Java

  • Default User Avatar

    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...

  • Custom User Avatar

    Thanks for solving. Please could you grade and rate this kata so that it passes out of beta if you havent do so yet :-)

  • Custom User Avatar

    Good suggestion thank you. I placed it into the initialize so that the code warrior could use it as they seem fit. :-)

  • Default User Avatar

    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...

  • Default User Avatar

    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.

  • Default User Avatar

    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.