Movatterモバイル変換


[0]ホーム

URL:


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

Commit152c7a2

Browse files
authored
Create Mirror Reflection.java
1 parent3a95bfa commit152c7a2

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

‎Medium/Mirror Reflection.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
classSolution {
2+
publicintmirrorReflection(intp,intq) {
3+
intextention =q;
4+
intreflection =p;
5+
while (extention %2 ==0 &&reflection %2 ==0) {
6+
extention /=2;
7+
reflection /=2;
8+
}
9+
if (extention %2 ==0 &&reflection %2 !=0) {
10+
return0;
11+
}elseif (extention %2 !=0 &&reflection %2 ==0) {
12+
return2;
13+
}else {
14+
return1;
15+
}
16+
}
17+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp