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.
it is trivial to avoid overflow when adding two 32-bit integers on a 64-bit platform.
the integer overflow occurs in the second line. since
a
andb
areunsigned
,a + b
is also anunsigned
. Your conversion tounsigned long long
occurs after the overflow has already happened.Common! What is this, You are generating 33 bit binary numbers, Is it really necessary to check that edge case, Last test couldnt pass, if you are giving unsigned int , stick with it.
Invalid result for a = 0, b = 0
Expected: equal to "0"
Actual: ""
but itry it on other compiler and it work!!!!!!
Perl translation
For the future please mention the language you are solving in. There was a bug in the TypeScript random test case generation. Now only positive numbers will be generated.
The description should mention that they expect negative binary result (-) too, otherwise we would present the result in a negative binary representative (2's complement)
Approved.
Approved.
Groovy Translation
Haskell translation
your Turkish is not clean bro, the audience can't figure out the slang
That's fair, thanks. Whenever I start looking at bit-level stuff I start wanting to make sure it's rock solid, a habit drilled into me from my professors.
It's 7 kyu kata, I don't think there's a need to make it more complicated than it already is
Loading more items...