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

Commitfd23399

Browse files
authored
Added Determine Color of a Chessboard Square.java
1 parentf48cd08 commitfd23399

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
classSolution {
2+
publicbooleansquareIsWhite(Stringcoordinates) {
3+
return (
4+
("aceg".indexOf(coordinates.charAt(0)) != -1
5+
&&Character.getNumericValue(coordinates.charAt(1)) %2 ==0) ||
6+
("aceg".indexOf(coordinates.charAt(0)) == -1
7+
&&Character.getNumericValue(coordinates.charAt(1)) %2 !=0)
8+
);
9+
}
10+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp