Marks :10
: 2 | : 0
Given a matrix, A of size M x N of 0s and 1s. If an element is 0, set its entire row and column to 0.
First line contains two space separated integers M and N ($$$1 \le M$$$,$$$N \le 1000$$$) represents the number of Rows and Columns respectively.
Each of the next M lines contains N space separated integers $$$A_i$$$ ($$$0 \le A_i \le 1$$$).
Print M rows where each row contains N space separated integers either 0 or 1 representing final matrix.
5 5 1 1 1 1 1 1 1 0 1 1 1 0 1 1 1 1 0 1 1 0 1 1 0 0 1
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
3 3 1 1 0 1 1 1 1 1 1
0 0 0 1 1 0 1 1 0
You need to login to view your submissions.
You need to login to view all submissions.
Result : Executed
Feel something is wrong with the test cases?
Result : Accepted
Test Cases :
But to Run or Submit the Problem, you need to Log In.
Continue to Log InYour challenge has been submitted successfully.
You will get a response soon via WhatsApp or Email.
Do let us know your issue.