Ad
  • Custom User Avatar

    Thank you, fixed.

  • Custom User Avatar

    Hey, thanks for the suggestion. I don't log on a lot anymore nowadays but took the opportunity to fix it up immediately.

  • Custom User Avatar

    Hey guys,

    My kata's been stuck in beta for almost half a year now, even though almost 80 people have tried it. Apparantely it is too difficult for many (and still rated 6 kyu on average?). I think this one is a good edge case to test the efficacy of the beta process. I'd also like it if someone would take a look at the kata and approve it.

    https://www.codewars.com/kata/5aba8a75206a29494000021b

    This has been quite demotivating for me to create other katas since my other one took many months to be approved as well. I hope you can help out.

    Thanks in advance :)

  • Custom User Avatar

    Nice one! Didn't take me too long and yet learned a lot about JS internals. :)

  • Custom User Avatar

    Thanks for the remark, I'll keep it in mind :P

  • Custom User Avatar

    I added the imports to the example tests and the static keyword in the solution setup.

    The java version has equivalent output to the JavaScript one and that one is correct. Are you sure your answer is okay?

  • Custom User Avatar

    Glad to hear it worked out :) Devil's in the details!

  • Custom User Avatar

    You guys sure you sorting lexicographically descending? I ran over it a few times but can't find a problem and my solutions for Java/Javascript are equivalent. I'd appreciate it if one of you could post your temporary solution as a spoiler so I can cross-reference :)

  • Custom User Avatar

    Forgot to change the example tests :) Used to be lower-case at first. The actual tests should not have the problem. Just fixed the example tests. Could be that you don't see the changes yet due to progress saving.

  • Custom User Avatar

    I see your random testing has worked out. Good kata :)

    Good luck with making more!

  • Custom User Avatar

    The way I'd do it, but not the best way:

    Check if the values fall within the defined range. Also a check (but not thorough) is to average 1000 or some other arbitrary sized calls. For instance, if you expect code to return a random string of two letters so [a-z][a-z] you could do the following:

    • Run it 1000 times.
    • Get the ascii value of each character
    • Add it to a sum of each character position and determine the average
    • Eventually you get something like 108.98, 110.20
    • The characters go from charcode 97 until 122. Expected average would be (97+122)/2 = 109.5
    • Check if the characters are near the expected average (i.e. 109.5) with an error margin of about 5%

    If this passes 10 times, you have a very high probability it is a uniform distribution. Or the cheater would have tricked it into falling with a small deviation from the average without an uniform distribution but that'd be harder than actually doing the challenge I think.

  • Custom User Avatar

    Does anyone have any hints? I've been completely rekt by this kata. Made a spreadsheet with a hell of a lot of numbers but can't for the life of me find a pattern.

  • Custom User Avatar

    Thanks for the shorter solution. I'm 100% new to Python :)