AlgoGenesis / C

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.
MIT License
81 stars 252 forks source link

[NEW ALGORITHM] Set Matrix Zero #1254

Open pranavbafna586 opened 5 hours ago

pranavbafna586 commented 5 hours ago

Problem Statement:

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.


Labels:

new algorithm, gssoc-ext, hacktoberfest, level1


Assignees:

github-actions[bot] commented 5 hours ago

👋 Thank you for raising an issue! We appreciate your effort in helping us improve. Our team will review it shortly. Stay tuned!