Back to problems

Black and White Chess Problem

Algorithm · Hudson River Trading · Medium

Given a two-dimensional chessboard whose cells contain either 'B' for black or 'W' for white, determine the size of the largest region made up of one color. Two cells belong to the same region when they share an edge—that is, they are directly adjacent horizontally or vertically. Return the area of the largest such region. Function Signature Constraints The board is two-dimensional. Each cell contains either 'B' or 'W'. Connectivity includes horizontal and vertical neighbors…

Checking your access…