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.
This comment is hidden because it contains spoiler information about the solution
JavaScript fixes
Resoved issues (at least for JS): 1, 2, 3, 4, 5
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
So I don't understand why I am getting a timeout error. My code works for every case, including the BigInt cases. And it works in ~50ms. How much faster does this code have to run?
This kata is a subject to deduplication process here: https://github.com/codewars/content-issues/issues/206.
Please join the discussion to help us identify duplicate kata and retire them.
The Java translation appears to allow solutions that don't strip (many) zeros.
I translated my Java solution to C, and I figured out I had to strip the leading zeros.
My solution probably passed the Java tests because I used
long
blocks for base 10**18, and so when I used every input digit as part of a base 10**18 digit, at most 17 zeros could be cut off by the block parsing and still get the right result.Someone could use base 10**19 if they want to deal with "unsigned" longs in Java, but I didn't.
Maybe add some fixed tests copied from the C translation?
This comment is hidden because it contains spoiler information about the solution
Got it! But it gives me a timeout error and I think I can not do the code smaller than it is...
Scala translation
Should ban all useful
BigXYZ
imports.This comment is hidden because it contains spoiler information about the solution
There is a test case which is trying to sum empty strings like 'test.assert_equals(sum_strings("", ""), "0")', this contradicts with the description of the kata
'Given the string representations of two integers ...'
'A string representation of an integer will contain no characters besides the ten numerals "0" to "9".'
Empty string is not a string representation of an integer.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Loading more items...