File tree 2 files changed +23
-0
lines changed
2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 264
264
1748|[ Sum of Unique Elements] ( ./1748-sum-of-unique-elements.js ) |Easy|
265
265
1780|[ Check if Number is a Sum of Powers of Three] ( ./1780-check-if-number-is-a-sum-of-powers-of-three.js ) |Medium|
266
266
1791|[ Find Center of Star Graph] ( ./1791-find-center-of-star-graph.js ) |Easy|
267
+ 1812|[ Determine Color of a Chessboard Square] ( ./1812-determine-color-of-a-chessboard-square.js ) |Easy|
267
268
1832|[ Check if the Sentence Is Pangram] ( ./1832-check-if-the-sentence-is-pangram.js ) |Easy|
268
269
1880|[ Check if Word Equals Summation of Two Words] ( ./1880-check-if-word-equals-summation-of-two-words.js ) |Easy|
269
270
1886|[ Determine Whether Matrix Can Be Obtained By Rotation] ( ./1886-determine-whether-matrix-can-be-obtained-by-rotation.js ) |Easy|
Original file line number Diff line number Diff line change
1
+ /**
2
+ * 1812. Determine Color of a Chessboard Square
3
+ * https://leetcode.com/problems/determine-color-of-a-chessboard-square/
4
+ * Difficulty: Easy
5
+ *
6
+ * You are given coordinates, a string that represents the coordinates of a square of
7
+ * the chessboard. Below is a chessboard for your reference.
8
+ *
9
+ * Return true if the square is white, and false if the square is black.
10
+ *
11
+ * The coordinate will always represent a valid chessboard square. The coordinate will
12
+ * always have the letter first, and the number second.
13
+ */
14
+
15
+ /**
16
+ * @param {string } coordinates
17
+ * @return {boolean }
18
+ */
19
+ var squareIsWhite = function ( coordinates ) {
20
+ const [ x , y ] = coordinates ;
21
+ return ( x . charCodeAt ( ) + + y ) % 2 !== 0 ;
22
+ } ;
You can’t perform that action at this time.
0 commit comments