Tap here to switch tabs
Problem
Submissions
Solution

Solution: 01 Matrix

Statement

Naive approach

A naive approach for this problem is to use a loop to iterate through every element in the matrix, and for every nonzero (11 in this case), we will iterate the whole matrix again and calculate the distance from that ...

Tap here to switch tabs
Problem
Submissions
Solution

Solution: 01 Matrix

Statement

Naive approach

A naive approach for this problem is to use a loop to iterate through every element in the matrix, and for every nonzero (11 in this case), we will iterate the whole matrix again and calculate the distance from that ...