Ad
  • Custom User Avatar
  • Custom User Avatar

    ball_test(2, xx___xx_x_xx_x_x_xxx____x______xxx_x_x_xxx____x_____x____x__xx____x_xxxx_xxx__x__x_xx___x___x__x__x_x_x___x______) should be true

    Really ?

    Edit: Refreshing the page and continuing to test the SAME code eventually resulted in some random tests that my code could pass.

  • Custom User Avatar

    Thanks! I was interpreting it that way, but I needed confirmation and your formulation is much clearer.

  • Custom User Avatar

    in my translations to the other hash cracking katas (SHA-1, SHA-256), I imported the proper header with an #include in the initial code. I did the same in my pending translations involving threading, SQLite, and sockets.

  • Custom User Avatar

    Guiding users about available libraries sounds like a good idea, and I think that such #include can be added to solution setup, either as actual code, or as a commented-out suggestion that it can be one of possible ways to use utilities provided by the platform?

  • Custom User Avatar

    my view is that #include <openssl/md5.h> should be present in the initial code. Many users are not aware that Codewars runs on Linux and that some libraries are installed, so these katas are unfair for them.

  • Custom User Avatar

    You can implement MD5 from scratch :) or you can use tools provided by the platform. Documentation for C setup mentions that library crypto is linked with code of C kata, and you can use OpenSSL's libcrypto and its functions.

    Or you can call command line utilities available on linux (but I do not know if they are installed in the CW runner).

  • Custom User Avatar

    In C, I just brute-forced it. The main difficulty for me was importing the MD5 function on Windows. I tried linking MinGW against OpenSSL, but the MD5 function had already been deprecated. Eventually, I realized there are built-in packages in Windows:

    #include <windows.h>
    #include <wincrypt.h>
    #pragma comment(lib, "advapi32.lib")

    However, this doesn’t seem to work on Codewars. Not really surprised but what are the alternatives to access the MD5 function on the site ?

  • Custom User Avatar

    Somewhere, a compiler is weeping, but your solution works hopefully!

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Without seeing the code we have no clue either.

  • Custom User Avatar

    I have two pieces of code on my machine (one iterative and one recursive), both of which work perfectly well in all cases. However, weirdly, the recursive one fails on the test provided here, even though the arrays for which it fails actually work just fine on my computer. No clue what the issue can be.