Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f16e119

Browse files
Update 3670.Maximum-Product-of-Two-Integers-With-No-Common-Bits.cpp
1 parent b7e9bcc commit f16e119

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

‎Trie/3670.Maximum-Product-of-Two-Integers-With-No-Common-Bits/3670.Maximum-Product-of-Two-Integers-With-No-Common-Bits.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,17 @@ class Solution {
2727
}
2828
if (i==31) return 0;
2929

30-
int b = ((x>>(30-i))&1);
31-
30+
int b = ((x>>(30-i))&1);
3231
if (b==1) {
3332
int ans = dfs(node->next[0], i+1, x);
3433
if (ans!=-1) return ans;
3534
else return -1;
3635
}
3736
else {
38-
int ans1 = dfs(node->next[1], i+1, x);
39-
int ans2 = dfs(node->next[0], i+1, x);
37+
int ans1 = dfs(node->next[1], i+1, x);
4038
if (ans1!=-1)
4139
return (1<<(30-i))+ans1;
40+
int ans2 = dfs(node->next[0], i+1, x);
4241
if (ans2!=-1)
4342
return ans2;
4443
return -1;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /