Skip to content

Commit f837138

Browse files
authored
Update count-pairs-with-xor-in-a-range.cpp
1 parent 2eb1647 commit f837138

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

C++/count-pairs-with-xor-in-a-range.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Solution {
2323
continue;
2424
}
2525
if (dp.count((x ^ 1) ^ k)) {
26-
result += v * dp[(x ^ 1) ^ k]; // current limit is 00001, count xor pair with 00000***** pattern
26+
result += v * dp[(x ^ 1) ^ k]; // current limit is 0...01*****, count xor pair with 0...00***** pattern
2727
}
2828
}
2929
dp = move(new_dp);
@@ -72,7 +72,7 @@ class Solution2 {
7272
int bit = (limit >> i) & 1;
7373
if (bit) {
7474
if (nodes[idx][curr]) {
75-
result += nodes[nodes[idx][curr]][2]; // current limit is 00001, count xor pair with 00000***** pattern
75+
result += nodes[nodes[idx][curr]][2]; // current limit is 0...01*****, count xor pair with 0...00***** pattern
7676
}
7777
}
7878
if (!nodes[idx][bit ^ curr]) {

0 commit comments

Comments
 (0)