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.
I am getting "uncaught exception: IOException of type UserError\nuser error (Expected expression to not compile but it did compile)", but stderr shows deferred type errors on all the tests that should not typecheck, which means my code is correctly making them not compile.
The bonus challenges are worthy of 2kyu but unfortunately it's not possible to check them.
This comment is hidden because it contains spoiler information about the solution
you're right, I'm dumb :P
No.
Shouldn't the output be an infinite sequence of zeros whenever the first element of the output is not 0?
Every element of the input appears 0 times in the output, and that's the least nonnegative number that satisfies the problem condition.
How can a code that is 3 lines long compile for as long as 5 seconds? How much recursive template metaprogramming can you fit into 3 lines?
I tried implementing merge sort but the typechecker seems to go into an infinite loop.
I implemented bubble sort and it works on the sample test cases but exceeds the time limit on the hidden test cases, even when limited to 2 iterations. I assume that's got to be the compilation time limit since I don't see how a comptime algorithm could cause long runtime...
Yeah so it is running arbitrary scripts, but not on a host machine. Arbitrary scripts are run in an isolated container.
I meant running arbitrary scripts on the host machine. The solution I commented on is nominally "in Haskell", but it actually writes a C file, compiles it using the host machine's GCC and then executes that instead.
(I cannot see the solution but) what else would it do when you type in your code and press SUBMIT? It basically runs your code. Whatever you type in.
Codewars allows arbitrary code execution??
how desperate are you?
"yes"