Tap here to switch tabs
Problem
Submissions

Problem: Determine Color of a Chessboard Square

Determine Color of a Chessboard Square gives a two-character coordinate and asks whether that position is white or black on a standard board whose bottom-left square, a1, is black.

Statement

You are given a string coordinates representing the position of a square on a chessboard.

Return true if the square is white, and false if the square is black.

A standard chessboard is an 8×88\times 8 grid where the bottom left square "a1" is black, and the colors alternate across adjacent rows and columns. The coordinate string consists of two characters, where the first character represents the column from 'a' to 'h' and the second character represents the row from '1' to '8'.

Constraints:

  • coordinates.length =2= 2

  • 'a' ≤\leq coordinates[0] ≤\leq 'h'

  • '1' ≤\leq coordinates[1] ≤\leq '8'

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Determine Color of a Chessboard Square

Determine Color of a Chessboard Square gives a two-character coordinate and asks whether that position is white or black on a standard board whose bottom-left square, a1, is black.

Statement

You are given a string coordinates representing the position of a square on a chessboard.

Return true if the square is white, and false if the square is black.

A standard chessboard is an 8×88\times 8 grid where the bottom left square "a1" is black, and the colors alternate across adjacent rows and columns. The coordinate string consists of two characters, where the first character represents the column from 'a' to 'h' and the second character represents the row from '1' to '8'.

Constraints:

  • coordinates.length =2= 2

  • 'a' ≤\leq coordinates[0] ≤\leq 'h'

  • '1' ≤\leq coordinates[1] ≤\leq '8'