Ad
  • Custom User Avatar

    For extra challenge you can try testing your solution with the input from this post:

            runTest("THIS + A + FIRE + THEREFORE + FOR + ALL + HISTORIES + I + TELL + A + TALE + THAT + FALSIFIES + ITS + TITLE + TIS + A + LIE + THE + TALE + OF + THE + LAST + FIRE + HORSES + LATE + AFTER + THE + FIRST + FATHERS + FORESEE + THE + HORRORS + THE + LAST + FREE + TROLL + TERRIFIES + THE + HORSES + OF + FIRE + THE + TROLL + RESTS + AT + THE + HOLE + OF + LOSSES + IT + IS + THERE + THAT + SHE + STORES + ROLES + OF + LEATHERS + AFTER + SHE + SATISFIES + HER + HATE + OFF + THOSE + FEARS + A + TASTE + RISES + AS + SHE + HEARS + THE + LEAST + FAR + HORSE + THOSE + FAST + HORSES + THAT + FIRST + HEAR + THE + TROLL + FLEE + OFF + TO + THE + FOREST + THE + HORSES + THAT + ALERTS + RAISE + THE + STARES + OF + THE + OTHERS + AS + THE + TROLL + ASSAILS + AT + THE + TOTAL + SHIFT + HER + TEETH + TEAR + HOOF + OFF + TORSO + AS + THE + LAST + HORSE + FORFEITS + ITS + LIFE + THE + FIRST + FATHERS + HEAR + OF + THE + HORRORS + THEIR + FEARS + THAT + THE + FIRES + FOR + THEIR + FEASTS + ARREST + AS + THE + FIRST + FATHERS + RESETTLE + THE + LAST + OF + THE + FIRE + HORSES + THE + LAST + TROLL + HARASSES + THE + FOREST + HEART + FREE + AT + LAST + OF + THE + LAST + TROLL + ALL + OFFER + THEIR + FIRE + HEAT + TO + THE + ASSISTERS + FAR + OFF + THE + TROLL + FASTS + ITS + LIFE + SHORTER + AS + STARS + RISE + THE + HORSES + REST + SAFE + AFTER + ALL + SHARE + HOT + FISH + AS + THEIR + AFFILIATES + TAILOR + A + ROOFS + FOR + THEIR + SAFE = FORTRESSES",
                    "9874 + 1 + 5730 + 980305630 + 563 + 122 + 874963704 + 7 + 9022 + 1 + 9120 + 9819 + 512475704 + 794 + 97920 + 974 + 1 + 270 + 980 + 9120 + 65 + 980 + 2149 + 5730 + 863404 + 2190 + 15903 + 980 + 57349 + 5198034 + 5630400 + 980 + 8633634 + 980 + 2149 + 5300 + 93622 + 903375704 + 980 + 863404 + 65 + 5730 + 980 + 93622 + 30494 + 19 + 980 + 8620 + 65 + 264404 + 79 + 74 + 98030 + 9819 + 480 + 496304 + 36204 + 65 + 20198034 + 15903 + 480 + 419745704 + 803 + 8190 + 655 + 98640 + 50134 + 1 + 91490 + 37404 + 14 + 480 + 80134 + 980 + 20149 + 513 + 86340 + 98640 + 5149 + 863404 + 9819 + 57349 + 8013 + 980 + 93622 + 5200 + 655 + 96 + 980 + 563049 + 980 + 863404 + 9819 + 120394 + 31740 + 980 + 491304 + 65 + 980 + 698034 + 14 + 980 + 93622 + 1441724 + 19 + 980 + 96912 + 48759 + 803 + 90098 + 9013 + 8665 + 655 + 96346 + 14 + 980 + 2149 + 86340 + 56350794 + 794 + 2750 + 980 + 57349 + 5198034 + 8013 + 65 + 980 + 8633634 + 98073 + 50134 + 9819 + 980 + 57304 + 563 + 98073 + 501494 + 133049 + 14 + 980 + 57349 + 5198034 + 30409920 + 980 + 2149 + 65 + 980 + 5730 + 863404 + 980 + 2149 + 93622 + 81314404 + 980 + 563049 + 80139 + 5300 + 19 + 2149 + 65 + 980 + 2149 + 93622 + 122 + 65503 + 98073 + 5730 + 8019 + 96 + 980 + 144749034 + 513 + 655 + 980 + 93622 + 51494 + 794 + 2750 + 4863903 + 14 + 49134 + 3740 + 980 + 863404 + 3049 + 4150 + 15903 + 122 + 48130 + 869 + 5748 + 14 + 98073 + 1557271904 + 917263 + 1 + 36654 + 563 + 98073 + 4150 = 5639304404")
    

    When I add it to example tests, my solution handles it in ~7-7.5s

  • Custom User Avatar

    I think you are misinterpreting test results:

    • The 6 seconds you see on Codewars includes time for compilaiton and startup of code runner. This takes a lot for Kotlin, around 6s, but once it's done, solutions are run quickly run after another. What you see is probably overhead of the runner and compiler, and not just the time spent for a solution.
    • I translated my Java solution to Kotlin and I am getting consistent ~9-10s every time I attempt the kata.
    • There is 16 Kotlin solutions, which would be unlikely if there were a "hardware problem".
    • If you say that 797275 + 5057 + 4027 + 4027 = 810386 takes for you 1s locally, then it is definitely too slow, or, at least, it's not a local test performed correctly. What you would have to try is to run 100 tests with inputs which go up to 7 elements of 6-8 digits. For example, 10 of tests I got is:
    ... snip 70 easier tests...
    CXLQ + OIICTQ + JUJQJLT + JTJICLT + XTBJLLOQ + TCJJOXO = LIOQULIQ
    DDDUDRR + DDGRRL + BBUFAGLL + BGDURLR + UIULSR + LUULDSGB + UGUIAFRB = RGFDAGRBA
    OAOIMFFP + OFMPMO + DHODFHH + PGMAAHG + IYGGPM + HOHDIA + PPYDPO = DHFHDHYP
    HSSH + RIISXRXX + DKIDKXH + ICPXRC + DFKCC + HHSRRXD + CICRFSC = IHDCDRKR
    QXOTOIIT + QQITJ + QXQCOTS + COXIOYFX + YSCCYXST + QCOQFST + OIJTSX = YISOYCOIX
    QQLHSH + ELIQQS + GDWTLETL + SSTWTQEH + STDLGGE + QWSHETT + LEIWQE = TLWLTWGWE
    QAZTFF + BZFQZGJY + TBATG + ZZZYG + AQZQA + BTQAZT + MTFZTQQ = AQTTYYFM
    TCXCCRXX + VHRR + XEEEH + UCXEUXR + CFBCFCFE + TURFTC + TCURRRV = FRCXTTRXX
    ZZZOHD + HTWHDHD + PTZLY + TLLTDLDT + ZYPIPYY + IWYLZZ + DDLPLP = ILZZTLITL
    LKMRKKD + RLRDIO + KOKMI + YKMYKDYY + RHIDI + DYRYIYOD + KYHDLKHI = KOIHKDLIA
    

    Try to solve above inputs locally, but to me it looks like you have to optimize your code beyond maximum. It never is a hardware problem.

  • Custom User Avatar

    I check on the tests given to me.

    It takes about 3-6 seconds to find 1 equation in the tests.

    And in IDEA it takes less than 1 second.

    Right now
    797275 + 5057 + 4027 + 4027 = 810386

    Here it is solved in 6 seconds, and in IDEA in 1 second.

    I have already optimized my code to the maximum.
    I think there is a hardware problem here.

  • Custom User Avatar

    Solutions being slow is not generally considered to be a kata issue. You jsut need to make yoursolution more efficient.

    When you say that your code works in IDEA, does it mean that it works for the same amount of tests, of the same sizes, with the same inputs?

  • Custom User Avatar

    Kotlin

    here in the tests my result is more than 16 seconds.
    I get an error
    Execution Timed Out (16000 ms)

    but in IDEA my result is 6 seconds

  • Custom User Avatar
  • Custom User Avatar

    Very nice computer programming concepts to exercise with.

  • Custom User Avatar

    Could you provide the issue you're encountering ? We can't help you if we don't know what's the error.

    (I won't be able to help you as I didn't solve but others will if they have all the information)

  • Custom User Avatar

    Not sure if someone is still working on the kata.

    Had an issue pop up with some of the PHP test cases. Doesn't seems to be an issue on my side.

    The code runs fine in my IDE but I get "undefined array key" in the test case file when running the code on CW.

    Let me know if other people are experiencing the same thing and if I maybe need to have a look at my code again (:

  • Custom User Avatar

    Go look up sliding puzzle and how inversions play a role. If a certain amount of numbers are "out-of-place" the puzzle becomes unsolvable.

  • Custom User Avatar

    3 April 2025. 478 lines. Python. 3662.47ms - 4524.12ms

    It took me 65 hours during 15 days.

    Great and very challenging kata.

  • Custom User Avatar

    Mine success all example test but failed random test .. whaaaat :((

  • Custom User Avatar

    Unfortunately it didn't. At least not for me. Why would "you can count it as one work capacity" mean that a job can be shared between two (or more) workers?
    It took me a lot of time (really a lot) to get what you meant.

  • Custom User Avatar

    The 5th test solution "RRRDDRDDRDRULLLUULUUURRRDDLURRDRDDR" is also missing for the Rust version.

  • Custom User Avatar
  • Loading more items...