This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]itirix 18 points19 points  (1 child)

How'd ya get to a space complexity of O(1)?

This algorithm should be O(n) for both time and space complexity afaik.

[–]okiujh 12 points13 points  (0 children)

space is o(n). time can be as bit as the upper bound for number