Skip to content

Commit 2c958e0

Browse files
committed
Solution as on 14-08-2022 11:20 pm
1 parent ec447be commit 2c958e0

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

0858. Mirror Reflection.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// 858.✅ Mirror Reflection
2+
3+
class Solution
4+
{
5+
public:
6+
int mirrorReflection(int p, int q)
7+
{
8+
while (p % 2 == 0 && q % 2 == 0)
9+
{
10+
p /= 2;
11+
q /= 2;
12+
}
13+
return 1 - p % 2 + q % 2;
14+
}
15+
};

0 commit comments

Comments
 (0)