-
Notifications
You must be signed in to change notification settings - Fork 43
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 - Tatiana #33
base: master
Are you sure you want to change the base?
Conversation
# Time complexity: ? | ||
# Space complexity: ? | ||
# Time complexity: On! | ||
# Space complexity: Constant |
There was a problem hiding this comment.
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.
def factorial(number) | ||
raise NotImplementedError | ||
end | ||
raise ArgumentError, "Bad Value" if number == nil |
There was a problem hiding this comment.
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
number *= minus_one | ||
minus_one -= 1 | ||
end | ||
return number |
There was a problem hiding this comment.
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! 🦄 👍
No description provided.