Skip to content

Ports - Faiza#19

Open
Faiza1987 wants to merge 1 commit intoAda-C11:masterfrom
Faiza1987:master
Open

Ports - Faiza#19
Faiza1987 wants to merge 1 commit intoAda-C11:masterfrom
Faiza1987:master

Conversation

@Faiza1987
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

@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.

end

row_set.each_with_index do |k|
for l in (0...matrix[k].length)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Two questions:

1). Why use .each_with_index for the outer loop if you don't end up using the index variable.
2). Why use a for-in loop here if you do an each with index for the outer loop?

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