Conversation
CheezItMan
left a comment
There was a problem hiding this comment.
Good work, you hit most of all the learning goals here. Well done.
Take a look at my comments regarding palindrome_permutations and let me know if you have any questions.
| @@ -1,4 +1,21 @@ | |||
|
|
|||
| def palindrome_permutation?(string) | |||
| letter_hash.each_value do |times| | ||
| if times % 2 != 0 | ||
| midpoint += 0 | ||
| end | ||
| end |
There was a problem hiding this comment.
You would do better here to see how many letters appear an odd number of times.
There was a problem hiding this comment.
Sorry about that, Chris! I had a typo in my code. so it should be
midpoint += 1 instead of midpoint += 0
I run rake file after that seems to fix the failures, would that be consider working for this method? Just wondering. Thanks!
`def palindrome_permutation?(string)
letter_hash = {}
string.split("").each do |letter|
if letter_hash[letter] == nil
letter_hash[letter] = 1
else
letter_hash[letter] += 1
end
end
midpoint = 0
letter_hash.each_value do |times|
if times % 2 != 0
midpoint += 1
end
end
return midpoint <= 1
end
`
| @@ -1,4 +1,28 @@ | |||
|
|
|||
| def permutations?(string1, string2) | |||
No description provided.