Ad
  • Custom User Avatar

    fixed (and added edge cases to fixed part of full tests)

  • Default User Avatar

    It's ugly but it works? The whole time I was coding this I couldn't shake the feeling that I was missing something that was going to requrie me to rewrite it almost from the ground up... but then, other than some reordering to match the expected order of things, it actually worked, so, uh, no rewrite needed, this ugly code I thought was doomed to be rewritten gets to be put on display!

  • Default User Avatar

    damned if I know. Just popped back in after a year away from the site, spent tons of time polishing and refining my first kata, and almost as much time after that trying to get it approved. It's still beta, no clue why. Doesn't really matter, I suppose, since I'm not really active on the site anymore - but my frustration was a major reason for that tbh :/

  • Default User Avatar

    ah, yeah, I forgot to come mark this resolved; thanks

  • Custom User Avatar

    Already approved by someone.

  • Default User Avatar

    I've forked the go translation to fix the issue here, if someone could approve it?

  • Default User Avatar

    Don't think you can approve your own, will need to get the original kata creator or someone else with high enough honor to approve it for you.

    The original creator hasn't been on since 2015, so probably no point holding your breat there; you can connect to the codewars gitter chat and ask someone there?

  • Default User Avatar

    yeah, I did that while testing actually. Just a bit of a sanity check. Like I said, this fork is not meant to be accepted/merged - I only published it so you could see what I was tlaking about, and will unpublish it now

  • Custom User Avatar

    About the test cases in the fork: you're calling my solution function instead of your own function, and then everything passes... which is to be expected. Your code is not even called. Only in the sample tests do you call your own code.

  • Custom User Avatar

    About the random thing being equal each run; that is of course by design. If you want to change that, srand() on time.

    About your test failing; you can check for yourself what the inputs are and what the output should be. If your code cannot reproduce it, the issue is really with your code.

    As for forking, I don't really get your intention. I will have a quick look at it, but don't have the time to fully analyze it. You indicated it shouldn't be accepted, hence I'll reject it.

  • Default User Avatar

    Actually, I tested everything with + EPS, then I tried to remove it before the final submission and it passed, so I don't know if it would have passed every time or not. I've added it back now.

  • Custom User Avatar

    Um... depends on the implementation, there could be many 'edge' cases.
    You could simply raise the times from 20 to 100 if you wish o_O

  • Default User Avatar

    so what you're saying is I should add edge cases like that to the fixed tests? <_< :evil laugh:

  • Custom User Avatar

    It's not slow, just an edge case like

    [0.06063410508099362, 0.16237818048291924, 0.12982549834001908, -0.1589744979205776, -0.19717508632071187, -0.12542437944438573, -0.26636647957973736, 0.19592829895911112]
    

    will cause it stuck into an infinite loop
    because the initial step is too huge for cases like this.

  • Default User Avatar

    ok, wow, I knew you guys' solutions were probably slower than mine because of the algorithm you used, but didn't realise just how much slower...

    added to the random tests, and you're timing out pretty hard now.

    For the record, my solution (which I didn't change) completes with the new set in <600ms, so... yeah.

  • Loading more items...