Conversation
CheezItMan
left a comment
There was a problem hiding this comment.
The methods work Anya, but you do need to look more closely at your space/time complexities.
| # Time complexity: O(n) | ||
| # Space complexity: O(n^2) | ||
| def factorial(n) |
| # Time complexity: O(n) | ||
| # Space complexity: O(n^2) | ||
| def reverse(s) |
There was a problem hiding this comment.
👍 But your space/time complexity is O(n^2)
| # Time complexity: O(n) | ||
| # Space complexity: O(n^2) | ||
| def reverse_inplace(s) |
There was a problem hiding this comment.
Consider adjusting the header to be like this.
def reverse_inplace(s, low=0, high=s.length - 1)
| # Time complexity: O(n) | ||
| # Space complexity: O(n) | ||
| def bunny(n) |
| # Time complexity: O(n) | ||
| # Space complexity: O(n^2) | ||
| def nested(s) |
There was a problem hiding this comment.
👍 However the space/time complexity are both O(n^2)
| # Time complexity: O(n) | ||
| # Space complexity: O(n^2) | ||
| def search(array, value) |
There was a problem hiding this comment.
👍 However the space/time complexity are both O(n^2)
| # Time complexity: O(n) | ||
| # Space complexity: O(n^2) | ||
| def is_palindrome(s) |
There was a problem hiding this comment.
👍 However the space/time complexity are both O(n^2)
| # Time complexity: O(n) | ||
| # Space complexity: O(n^2) | ||
| def helper_digit_match(n_string, m_string, matches) |
There was a problem hiding this comment.
👍 However the space/time complexity are both O(n^2)
No description provided.