-
Notifications
You must be signed in to change notification settings - Fork 47
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
Space - Lee #35
base: master
Are you sure you want to change the base?
Space - Lee #35
Conversation
…h depending on whether the string length is odd or even, passes all tests
…re different', see comments
… of specific letters are different
…er are different, but the string lengths are the same', 2 failures in other tests
…es, passes all tests!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work, you hit most of 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,17 @@ | |||
def intersection(list1, list2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
lib/palindrome_permutation.rb
Outdated
if string.length.even? # the palindrome should have two of each letter | ||
return lookup_hash.length == string.length / 2 | ||
elsif string.length.odd? # the palindrome should have only one odd letter out | ||
return lookup_hash.length == (string.length / 2) + 1 | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this would work if a letter appears more than 2 times. Consider oooo
, it's a palindrome, if a weird one.
@@ -1,4 +1,28 @@ | |||
|
|||
def permutations?(string1, string2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I think this could be simplified a bit, but otherwise well done.
No description provided.