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.
10 months ago and nobody fixed it yet? Wow!
I'd guess that the reason is you can't get much faster than just int
*
with a manually written algorithm for multiplication. The base conversion into binary (internal representation ofint
) was the slow part for add. Maybe should test it out.The similar (probably a little easier) kata "Sum strings as numbers" says
Python: your solution need to work with huge numbers (about a milion digits), converting to int will not work.
Can't we have a likewise test with huge numbers in this kata as well?
Because the kata was originally about writing algorithms which manually multiply very large numbers. In Python, numbers can get as big as you want, so solving this would be as simple as
Which is neither interesting, nor worthy of a 4kyu rank.
This kata doesn't make sense for languages with native
BigInt
support (even though there's translations for languages that do supportBigInt
, in the future, I think they will be removed).This comment is hidden because it contains spoiler information about the solution
Fixed C++ sample tests.
Actually, I agree...
Fixed
That should return nil, null, None or Nothing
Sorry: I don't see such a case (C++ ?).
How about the following edge case?
Should this test return an answer, because 101 is within the range, or should it not return an answer because 103 is out of range?
It's not clear for me from the decription and examples.
Simple: we switch to Java or C#.
Switch to Java or C#
Yes, it was difficult. How do you C++ people debug such things?
Sure, it was. Yet, if I do similar mistake in other programming languages, I typically get a compiler error.
I think this is a real disadvantage of C++. Code compiles (and for whatever reason even worked), so how should I find out I made a mistake?
This time I was lucky, because Codewars uses a different compiler or whatever. If this were production code, it would have gone unnoticed.
I want to prepare myself for real-world C++ with Codewars. Any additional hints are welcome.
Question resolved.
Loading more items...