Skip to content

Commit 9bc28dd

Browse files
solves determine color f chessboard
1 parent 59679ca commit 9bc28dd

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@
440440
| 1796 | [Second Largest Digit in a String](https://leetcode.com/problems/second-largest-digit-in-a-string) | [![Java](assets/java.png)](src/SecondLargestDigitInAString.java) | |
441441
| 1800 | [Maximum Ascending Subarray Sum](https://leetcode.com/problems/maximum-ascending-subarray-sum) | [![Java](assets/java.png)](src/MaximumAscendingSubArraySum.java) | |
442442
| 1805 | [Number of Different Integers in a String](https://leetcode.com/problems/number-of-different-integers-in-a-string) | [![Java](assets/java.png)](src/NumberOfDifferentIntegersInString.java) | |
443-
| 1812 | [Determine Color of a Chessboard Square](https://leetcode.com/problems/determine-color-of-a-chessboard-square) | | |
443+
| 1812 | [Determine Color of a Chessboard Square](https://leetcode.com/problems/determine-color-of-a-chessboard-square) | [![Java](assets/java.png)](src/DetermineColorOfChessboardSquare.java) | |
444444
| 1816 | [Truncate Sentence](https://leetcode.com/problems/truncate-sentence) | | |
445445
| 1822 | [Sign of the Product of an Array](https://leetcode.com/problems/sign-of-the-product-of-an-array) | | |
446446
| 1826 | [Faulty Sensor](https://leetcode.com/problems/faulty-sensor) | | |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
public class DetermineColorOfChessboardSquare {
2+
public boolean squareIsWhite(String coordinates) {
3+
return ((coordinates.charAt(0) - 'a') + (coordinates.charAt(1) - '1')) % 2 == 1;
4+
}
5+
}

0 commit comments

Comments
 (0)