Created
April 1, 2020 04:44
-
-
Save wushbin/b9e07a5cfb92f4d12695527f8bd3b514 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Solution { | |
| public int rangeBitwiseAnd(int m, int n) { | |
| int i = 0; | |
| while(m != n) { | |
| m >>= 1; | |
| n >>= 1; | |
| i++; | |
| } | |
| return m << i; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment