← Flipkart questions

Replace 'O' surrounded by 'X' with '#'

Filed under Flipkart

Given an m x n matrix containing 'X' and 'O', capture all regions that are 4-directionally surrounded by 'X'. A region is captured by replacing all 'O's in that region with '#'.

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 Flipkart questions

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