Last active
December 8, 2017 17:42
-
-
Save nhuntwalker/22ba0b1077ee499708669e3859b4a564 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Write an algorithm such that if an element in an MxN matrix is 0, its entire row and column are set to 0. | |
Ex: | |
input matrix = [ | |
[0, 2, 3, 4, 5], | |
[6, 7, 8, 9, 10], | |
[1, 5, 0, 7, 33], | |
[6, 7, 8, 9, 10], | |
[6, 7, 8, 9, 10], | |
] | |
output = [ | |
[0, 0, 0, 0, 0], | |
[0, 7, 0, 9, 10], | |
[0, 0, 0, 0, 0], | |
[0, 7, 0, 9, 10], | |
[0, 7, 0, 9, 10], | |
] | |
Email to nicholas@codefellows.com by 9:56am |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment