Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
C# Translation
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.
Thanks! I was interpreting it that way, but I needed confirmation and your formulation is much clearer.
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.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?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.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'slibcrypto
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).
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 ?
Somewhere, a compiler is weeping, but your solution works hopefully!
This comment is hidden because it contains spoiler information about the solution
Without seeing the code we have no clue either.
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.