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

Sockets - Erica #13

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Sockets - Erica #13

wants to merge 3 commits into from

Conversation

norrise120
Copy link

No description provided.

Copy link

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This definitely works and with the space & time complexity you listed. There is a counterintuitive way to solve the problem without the sets you used, instead using the 1st row and 1st column to store the row and columns to zero out. However this is a good solution. Nice work.

# Time complexity: ?
# Space complexity: ?
# Time complexity: O(n*m), where n is the number of rows and m is the number of columns in the matrix
# Space complexity: O(n), where n is the number of elements in the matrix.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I'd say this is O(n) where n is the number of rows or columns in the matrix. You're not building an additional 2D array.

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