Mirror Reflection LeetCode solution in Java

1
class Solution {
2
public int mirrorReflection(int p, int q) {
3
while (p % 2 == 0 && q % 2 == 0) {
4
p >>= 1;
5
q >>= 1;
6
}
7
return 1 - p % 2 + q % 2;
8
}
9
}
10
;

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0