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

Time - HannahT #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

stpatrickschild
Copy link

… note from the .rb file, it helps when I return and read the code

… note from the .rb file, it helps when I return and read the code
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.

Outstanding work, you hit all the learning goals here. Well done.

Take a look at my comments and let me know if you have any questions.

@@ -1,3 +1,32 @@
def intersection(list1, list2)

Choose a reason for hiding this comment

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

This works, but it's O(n * m) in time complexity. Using a hash you can get this to O(n + m) time complexity which is much better.

I encourage you to think about how to do this.

@@ -1,4 +1,23 @@

require_relative "permutations.rb"
# Added a new test:)
def palindrome_permutation?(string)

Choose a reason for hiding this comment

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

👍 nice and good helper method.

@@ -1,4 +1,49 @@

def permutations?(string1, string2)

Choose a reason for hiding this comment

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

👍

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