Solution 1: NC
Have problem with test cases:
4294967295 (11111111111111111111111111111111).
-2147483647 (1000 0000 0000 0000 0000 0000 0000 0000).
|
|
Solution 2: accepted 2ms
- Unsigned: use >>> rather than >>
- Cannot use n >= 1, as some test cases will be recognized as negative number in java
|
|