← Amazon questions

Matrix zero-one propagation and cost optimization

Filed under Amazon

Given a 2D matrix of zeroes and ones, any row or column containing a single 1 is made completely 1. Then, modify the solution assuming space limitations and a cost attached to accessing each cell.

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.