← Amazon questions

Replace 'O' with 'X' if surrounded by 'X'

Filed under Amazon · Also reported at OYO, PlaySimple Games

Given an m x n matrix containing 'X' and 'O', capture all regions surrounded by 'X'. A region is captured by flipping all 'O's into 'X's in that surrounded region. Any 'O' on the boundary of the…

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Amazon questions

Collected from public candidate posts and coding forums. Updated Nov 2026.