Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

matrix_convert_to_zero by Jessie #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jessiezhang2017
Copy link

@jessiezhang2017 jessiezhang2017 commented Oct 29, 2018

if the matrix has m columns and n rows , the space complexity is O(n+m)
time complexity is O(n*m)

@shrutivanw
Copy link

Nice work!

The only further optimization I could think of was to use the 0th row and the 0th column to track which columns and rows need to be converted to zero. Here's my solution with that: https://github.com/Ada-C10/matrix_convert_to_zero/blob/solution-basic/lib/matrix_convert_to_zero.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants