AlgoGenesis is a centralized open-source platform dedicated to providing optimized and well-documented algorithm implementations in C. Perfect for both beginners and advanced users, this repository serves as a comprehensive learning resource for solving algorithmic challenges.
Given a matrix, if any element in the matrix is 0, you must set its entire row and column to 0. Return the modified matrix.
Input:
matrix = [[1,1,1],[1,0,1],[1,1,1]]
Output:
[[1,0,1],[0,0,0],[1,0,1]]
Explanation:
Since matrix[1][1] = 0, the entire second row and second column are set to 0.
Issue will be closed if:
1) You mention more than one algorithm. You can create a separate issue for each algorithm once the current one is completed.
2) You propose an algorithm that is already present or has been mentioned in a previous issue.
3) You create a new issue without completing your previous issue.
Note: These actions will be taken seriously. Failure to follow the guidelines may result in the immediate closure of your issue.
Name:
Set Matrix Zero [NEW ALGORITHM]
About:
Propose a new algorithm to set specific rows and columns to zero in a matrix based on the presence of zero elements.
Problem Statement:
Given a matrix, if any element in the matrix is
0
, you must set its entire row and column to0
. Return the modified matrix.Input:
Output:
Explanation: Since
matrix[1][1] = 0
, the entire second row and second column are set to0
.Issue will be closed if:
Note: These actions will be taken seriously. Failure to follow the guidelines may result in the immediate closure of your issue.
Name:
Set Matrix Zero [NEW ALGORITHM]
About:
Propose a new algorithm to set specific rows and columns to zero in a matrix based on the presence of zero elements.
Labels:
new algorithm, gssoc-ext, hacktoberfest, level1
Assignees: