Skip to content

Conversation

@RPerry
Copy link

@RPerry RPerry commented May 27, 2019

No description provided.

Copy link

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

Nice work, you've got the methods you wrote working well. I made a few comments, but you did quite well. Just remember that if you do s[0... s.length -1] you create a new string which adds to time and space complexity.

Let me know if you have questions.


# Time complexity: ?
# Space complexity: ?
# Time complexity: O(n)

Choose a reason for hiding this comment

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

Time complexity is also O(n^2) since you have n recursive calls and each call creates a new array with s[1..-1]


# Time complexity: ?
# Space complexity: ?
# Time complexity: O(n)

Choose a reason for hiding this comment

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

👍

raise NotImplementedError, "Method not implemented"
if n == 0
return 0
else return 2 + bunny(n-1)

Choose a reason for hiding this comment

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

Cleaning up this indentation would be better.

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