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 don't think the solver should be in the position that they end up not knowing how their solution is called. "Your code should handle THIS" and then doesn't say what "THIS" is. That's weird, and something about that is an issue with codewars in general.
But the
issue
tag comes with burden of proof and I didn't want that tag to be useful in debugging your code when replying within a few minutes.You are very likely printing multiple test cases.
I've found a way to work around it.
Then please tell me how I should print it. It'll be very helpful to me if I could get the actual input when trying to figure out where I went wrong. I might also be able to resolve the issue if it turns out I am doing it wrong.
I could add that my current way of doing it is like this:
I use the extra characters(aside from the variable s) in order to copy it into vsc easier. But I'll throw in the result I get with the normal way of doing it:
I'm gonna go out on a limb and guess that whatever you're using to print the input is rather half-assed and that what you're showing ain't it.
I think there is an issue with the tests. Input:
In here, there are 4 registers, a, b, c, and d.
The test expects 3. c is left out. Going through it manually, it does seem like c is supposed to be processed on it's first occurrence "mov c 0"
I recieve the error message
This comment is hidden because it contains spoiler information about the solution
The windows ansi (e.g) encoding for "¤" is 164 but the UTF8-Encoding for "¤" is: {194, 164} or in Trinary {"21012", "20002"}. The question mark means there is no valid UTF8 encoding given.
As you can see in https://en.wikipedia.org/wiki/UTF-8 under the heading "Code point UTF-8 conversion" there are 2 bytes required for the character "¤" resp. ¤c resp. Ansi1252 = 164
The assert should be
Please note the inserted 021012.
Hi!
Sorry I'm slow to answer, been away for a while.
The space was originally left in there intentionally, but I forgot to remove it when I decided to only have correct test inputs. I'll fix that right away.
An emoji test would be fun, but I'd have to adjust my current solution before I do that!
As for your solution, I'm not quite sure where it goes wrong. The decimal for ? is 63, the trinary would be 002100. The decimal for ¤ is 164, the trinary would be 020002. I can't see why your code confuse these two. I would suggest testing the code with different inputs and see where things stop working.
This comment is hidden because it contains spoiler information about the solution
Thanks! I didn't even think about that part. Forgive me, it's my first kata! I have fixed it now.
The first point means that when I want to solve your kata and open the kata trainer view, there is already some code for some unrelated problem (it is an example of C# kata. it is meant as help for authors, and should not be a part of a published kata).
I'm not quite sure what you mean by the first point, but I could make some random tests.
The first thing I thought was "Really? This simple?" Then I realized why we were to use BigIntegers.
It was a nice way to force me into learning more about kotlin's long variable!
I checked out the C# version. All the random test have an array with 10 ints. Kotlin varies with up to 100k per test. I can sometimes get through 10+ random tests within the 16000ms, but other times I just go through 2. At this point, I can just click 500 times on attempt and hope to god all the random tests give me <10000 ints in the array. This is ridiculous.
Loading more items...