Skip to content

Practice Check if Two Chessboard Squares Have the Same Color

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Easy#3274
LeetCode Problem

Check if Two Chessboard Squares Have the Same Color

Problem Statement

The chessboard has columns a through h and rows 1 through 8, with a1 black and horizontally or vertically adjacent cells of opposite colors. Given valid coordinate1 and coordinate2, each written as its column letter followed by its row digit, return whether they have the same color.

Source: Check if Two Chessboard Squares Have the Same Color on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
coordinate1 = "a1", coordinate2 = "c3"
Output
true

# Example 2

Input
coordinate1 = "a1", coordinate2 = "h3"
Output
false

Constraints

coordinate1.length == coordinate2.length == 2
'a' <= coordinate1[0], coordinate2[0] <= 'h'
'1' <= coordinate1[1], coordinate2[1] <= '8'

Related LeetCode Problems

Practice more problems similar to Check if Two Chessboard Squares Have the Same Color.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.