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.
Groovy translation
for 5 kyu I agree that this would not be overkill, however it would never be consistent since half the languages have a built-in big-integer type which obviates the need to implement the bigint + 1 algorithm manually
I agree that inconsistency is an issue, but I am not sure whether "bigint + 1" is Rust specific, and whether it's an overkill task for a 5 kyu challenge.
I think this is an issue, because if the suffixes do not fit in a built-in integer type, the required solution becomes significantly harder and is essentially an easier version of "implement big integer add". My submitted JavaScript and C solutions turn the suffix into an integer and back into a string, so if Rust does not allow that, there is an inconsistency between versions. I looked at the reference solution in Rust and it does implement a simplified big-integer add with carry.
Why is this an issue? Numbers in inputs can be large and exceed
u128
, why would this be a problem?This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Ugh, this got much harder than the way I thought to solve it.
This comment is hidden because it contains spoiler information about the solution
And what does your solution return in your IDE for
incrementString("foobar000")
?testing's ok, the problem is that it fails on the examples on codewars but when i test the same examples in ide it works just fine
If your code fails on Codewars but seems to work in your IDE, it usually does not mean that the code is correct. It means that you are testing it in the IDE incorrectly.
count the zeroes in both strings.
Try to run it in a normal compiler in an IDE, it will and it does run correctly - so the code is in fact correct.
issue
tag to ask for help, ask aquestion
insteadLoading more items...