Skip to content

Commit 7ef4192

Browse files
committed
137
1 parent d0ceb05 commit 7ef4192

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

leetcode/137. Single Number II/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ For each bit for each number, if the bit is 1 for 3 times, reset it to 0. The le
3030
class Solution {
3131
public:
3232
int singleNumber(vector<int>& nums) {
33-
int ans = 0;
33+
unsigned ans = 0;
3434
for (int i = 0; i < 32; ++i) {
3535
int cnt = 0;
36-
for (int n : nums) {
36+
for (unsigned n : nums) {
3737
cnt = (cnt + ((n >> i) & 1)) % 3;
3838
}
3939
ans |= cnt << i;

0 commit comments

Comments
 (0)