Class Solution
java.lang.Object
g1801_1900.s1812_determine_color_of_a_chessboard_square.Solution
1812 - Determine Color of a Chessboard Square.<p>Easy</p>
<p>You are given <code>coordinates</code>, a string that represents the coordinates of a square of the chessboard. Below is a chessboard for your reference.</p>
<p><img src="https://assets.leetcode.com/uploads/2021/02/19/screenshot-2021-02-20-at-22159-pm.png" alt="" /></p>
<p>Return <code>true</code> <em>if the square is white, and</em> <code>false</code> <em>if the square is black</em>.</p>
<p>The coordinate will always represent a valid chessboard square. The coordinate will always have the letter first, and the number second.</p>
<p><strong>Example 1:</strong></p>
<p><strong>Input:</strong> coordinates = “a1”</p>
<p><strong>Output:</strong> false</p>
<p><strong>Explanation:</strong> From the chessboard above, the square with coordinates “a1” is black, so return false.</p>
<p><strong>Example 2:</strong></p>
<p><strong>Input:</strong> coordinates = “h3”</p>
<p><strong>Output:</strong> true</p>
<p><strong>Explanation:</strong> From the chessboard above, the square with coordinates “h3” is white, so return true.</p>
<p><strong>Example 3:</strong></p>
<p><strong>Input:</strong> coordinates = “c7”</p>
<p><strong>Output:</strong> false</p>
<p><strong>Constraints:</strong></p>
<ul>
<li><code>coordinates.length == 2</code></li>
<li><code>'a' <= coordinates[0] <= 'h'</code></li>
<li><code>'1' <= coordinates[1] <= '8'</code></li>
</ul>
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Solution
public Solution()
-
-
Method Details
-
squareIsWhite
-