Re: 10469 - To Carry or not to Carry
Posted: Tue Mar 05, 2013 6:25 am
omarking05 wrote:please can anyone tell me whats wrong with this code ?
- I think you left some "debugging" couts by accident in this code. I hope you didn't left those in your real submissions, but check that, just in case.
- Notice how the problem statement is very emphatic about the input numbers being unsigned 32-bit numbers. Consider the range of such numbers. You may try the test cases below.
- There is a much simpler approach. Review the basic bitwise operators. Can you find an operator that works just like this problem describes?
- There is already a thread for this problem. Please search the forums before posting a question and use an existing thread if possible. Thanks.
Code: Select all
2147483648 1
893183290 1236679790
Code: Select all
2147483649
2089474388