forked from wisdompeak/LeetCode
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit 6eb1f47
committed
Fix integer overflow in LC260. Single Number III
- Changed `int` to `long long` for variable `s` to prevent
overflow when handling `INT_MIN` (`-2147483648`).
- Updated `t` to use `long long` to ensure correctness in
bit manipulation.
- Fixes issue with new test case: `nums = [1,1,0,-2147483648]`,
where `int` overflowed due to `s & (s-1)`.1 parent 1c25251 commit 6eb1f47
File tree
1 file changed
+2
-2
lines changed- Bit_Manipulation/260.Single-Number-III
1 file changed
+2
-2
lines changedLines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
5 | - | ||
5 | + | ||
6 | 6 |
| |
7 | - | ||
7 | + | ||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
|
0 commit comments