Skip to content

Commit 543c45c

Browse files
committed
Create README - LeetHub
1 parent 701ebda commit 543c45c

File tree

1 file changed

+38
-0
lines changed
  • 1812-determine-color-of-a-chessboard-square

1 file changed

+38
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<h2><a href="https://leetcode.com/problems/determine-color-of-a-chessboard-square/">1812. Determine Color of a Chessboard Square</a></h2><h3>Easy</h3><hr><div><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>
2+
3+
<p><img alt="" src="https://assets.leetcode.com/uploads/2021/02/19/screenshot-2021-02-20-at-22159-pm.png" style="width: 400px; height: 396px;"></p>
4+
5+
<p>Return <code>true</code><em> if the square is white, and </em><code>false</code><em> if the square is black</em>.</p>
6+
7+
<p>The coordinate will always represent a valid chessboard square. The coordinate will always have the letter first, and the number second.</p>
8+
9+
<p>&nbsp;</p>
10+
<p><strong class="example">Example 1:</strong></p>
11+
12+
<pre><strong>Input:</strong> coordinates = "a1"
13+
<strong>Output:</strong> false
14+
<strong>Explanation:</strong> From the chessboard above, the square with coordinates "a1" is black, so return false.
15+
</pre>
16+
17+
<p><strong class="example">Example 2:</strong></p>
18+
19+
<pre><strong>Input:</strong> coordinates = "h3"
20+
<strong>Output:</strong> true
21+
<strong>Explanation:</strong> From the chessboard above, the square with coordinates "h3" is white, so return true.
22+
</pre>
23+
24+
<p><strong class="example">Example 3:</strong></p>
25+
26+
<pre><strong>Input:</strong> coordinates = "c7"
27+
<strong>Output:</strong> false
28+
</pre>
29+
30+
<p>&nbsp;</p>
31+
<p><strong>Constraints:</strong></p>
32+
33+
<ul>
34+
<li><code>coordinates.length == 2</code></li>
35+
<li><code>'a' &lt;= coordinates[0] &lt;= 'h'</code></li>
36+
<li><code>'1' &lt;= coordinates[1] &lt;= '8'</code></li>
37+
</ul>
38+
</div>

0 commit comments

Comments
 (0)