Given an m x n matrix, if an element is 0, set its entire row and column to 0, and do this in place.
matrix = [[1,1,1],[1,0,1],[1,1,1]][[1,0,1],[0,0,0],[1,0,1]]Solve it in the editor. Sign in free to run your Python or JavaScript against test cases, get a verdict, and track your attempts.
Solve on FeatCode →A grab-bag of problems solved with numeric or coordinate reasoning rather than a specific data structure — matrix manipulation, simulation, and basic number theory.
Read the full Math & Geometry guide →
Original problem on LeetCode ↗