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

Earth - Kal #44

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Earth - Kal #44

wants to merge 2 commits into from

Conversation

kashenafi
Copy link

No description provided.

@kashenafi kashenafi changed the title complete + tests passing Earth - Kal Nov 23, 2020
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 Kal, thanks for getting this in. The methods you wrote all work, but I had some feedback on time/space complexity.

Comment on lines +3 to 5
# 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.

👍

Comment on lines +11 to +13
# Time complexity: O(n^2), where n is the length of the string
# Space complexity: O(n^2), where n is the length of the string
def reverse(s, pointer = s.length - 1)

Choose a reason for hiding this comment

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

👍

Comment on lines +19 to 21
# Time complexity: O(n), where n is the length of the string. (More precisely, n/2)
# Space complexity: O(n), where n is the length of the string. (More precisely, n/2)
def reverse_inplace(s)

Choose a reason for hiding this comment

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

👍 Nicely done!

Comment on lines +35 to 37
# Time complexity: O(n)
# Space complexity: O(n)
def bunny(n)

Choose a reason for hiding this comment

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

👍

Comment on lines +43 to +45
# Time complexity: O(n), where n is the length of the string
# Space complexity: O(n), where n is the length of the string
def nested(s, parens_counter = 0, pointer = 0)

Choose a reason for hiding this comment

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

👍

Comment on lines +53 to +55
# Time complexity: O(n), where n is the length of the string
# Space complexity: O(n), where n is the length of the string
def search(array, value, pointer = 0)

Choose a reason for hiding this comment

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

👍

Comment on lines +61 to +63
# Time complexity: O(n), where n is the length of the string (More precisely, n/2)
# Space complexity: O(n), where n is the length of the string (More precisely, n/2)
def is_palindrome(s, length = s.length, pointer = 0)

Choose a reason for hiding this comment

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

👍 Well done!

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