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 - Jansen #20

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

Conversation

JansenMartin
Copy link

No description provided.

# Time complexity: ?
# Space complexity: ?
# Time complexity: Linear or O(n), where n stands for input. However many times the loop runs depends on input.
# Space complexity: Constant 1(n), where n stands for input. Additional space doesn't rely on input.

Choose a reason for hiding this comment

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

🤔 I thought it was written as O(1)?

i += 1
end

return factorial

Choose a reason for hiding this comment

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

Nice work!

raise NotImplementedError
raise ArgumentError if number == nil

i = 2

Choose a reason for hiding this comment

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

Interesting approach. i = 2 feels like 2 should be a well named constant, since right now there's no indication of why it is set to two.

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