Surrounded Regions

Preview

Given an m x n matrix grid containing only characters 'X' and 'O', modify grid to replace all regions of 'O' that are completey surrounded by 'X' with 'X'.

Sign in to read the full chapter.

Checking access…