Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution {
- /**
- *@param a, b: Two integer
- *return: An integer
- */
- public static int bitSwapRequired(int a, int b) {
- // write your code here
- int count = 0;
- for (int c = a ^ b; c != 0; c = c >>> 1) {
- count += c & 1;
- }
- return count;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment