← Mastercard questions
CodingEasy

Count cells with at least one adjacent 1 in binary matrix

Filed under Mastercard

The question

Given a binary matrix with 0s and 1s, count the number of cells that have at least one adjacent cell containing 1.

No write-up yet. Related questions below have one.

Related Mastercard questions

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