Skip to content

Sockets - Tatiana#33

Open
tatsqui wants to merge 4 commits intoAda-C11:masterfrom
tatsqui:master
Open

Sockets - Tatiana#33
tatsqui wants to merge 4 commits intoAda-C11:masterfrom
tatsqui:master

Conversation

@tatsqui
Copy link
Copy Markdown

@tatsqui tatsqui commented Apr 11, 2019

No description provided.

Comment thread lib/factorial.rb
# Time complexity: ?
# Space complexity: ?
# Time complexity: On!
# Space complexity: Constant
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Make sure to explain your reasoning behind time and space complexity.

Comment thread lib/factorial.rb
def factorial(number)
raise NotImplementedError
end
raise ArgumentError, "Bad Value" if number == nil
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

If you want to also cover bad string integer input, consider:
raise ArgumentError, "Bad Value" if number.is_a?(Integer) == false || number == nil

Comment thread lib/factorial.rb
number *= minus_one
minus_one -= 1
end
return number
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice work on this method! 🦄 👍

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