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

Layla - Edges - matrix sum #20

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

Conversation

lbristol88
Copy link

The time complexity is O(n squared) cause there are two nested loops. I think the space complexity is O(n).

@shrutivanw
Copy link

Nice work! I encourage you to elaborate a little more while explaining the reasoning behind your time complexity.

The problem statement encouraged you think of a solution that optimizes the space complexity as much as possible. With that in mind, can you think of how you may tweak your algorithm to optimize the space complexity further? Think more about it and then tally your solution with mine here: https://github.com/Ada-C10/matrix_check_sum/blob/solution/lib/matrix_check_sum.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