Skip to content

Conversation

@geomsb
Copy link

@geomsb geomsb commented Nov 12, 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.

This is great work. I had a few comments, but they are minor. You hit the learning goals here. Well done!

# Space complexity: ?
# Time complexity: O(n)
# Space complexity: O(n)
def factorial(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"
# Time complexity: 0(n)
# Space complexity: 0(n)
def reverse(s, i = 0, j = -1, n_s = "")

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"
# Time complexity: 0(n)
# Space complexity: 0(n)
def reverse_inplace(s, i = 0, j = -1)

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"
# Time complexity: O(n)
# Space complexity: O(n)
def bunny(n, i = 0, j = 0)

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"
# Time complexity: O(n)
# Space complexity: O(n)
def nested(s, i = 0, ope = 0, close = 0)

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"
# Time complexity: O(n)
# Space complexity: O(n)
def search(array, value, i = 0)

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"
# Time complexity: O(n)
# Space complexity: O(n)
def is_palindrome(s, i = 0, j = -1, coun = 1)

Choose a reason for hiding this comment

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

👍

Comment on lines +101 to +108
if i < n.length
if n[i] == m[i]
return digit_match(n, m, i + 1, coun + 1)
else
return digit_match(n, m, i + 1, coun)
end
else
return coun

Choose a reason for hiding this comment

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

This assumes the two numbers start with the same number of digits. Maybe this would be better, if you started at the last digit.

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