top | item 38953276

(no title)

cmptrnerd6 | 2 years ago

Edge cases. If d is very large then 2*d might be larger than what can be computed.

Also I think the code could just multiply d by -1 which would "reverse the sign".

Even that has some edge cases that should be handled around the maximum value of an integer.

But the main thing to me is that as written this code is confusing and overcomplicating the easy part of the problem.

discuss

order

No comments yet.