Tap here to switch tabs
Problem
Submissions

Problem: Determine Color of a Chessboard Square

med
30 min
Try to solve the Determine Color of a Chessboard Square problem.

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 imes $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

med
30 min
Try to solve the Determine Color of a Chessboard Square problem.

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 imes $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'