Created
April 26, 2015 14:56
-
-
Save oleglukashev/6af90684dfbc42bb87b9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def solution(text) | |
sourse = text.split("").group_by(&:capitalize) | |
count_chars_without_pair = sourse.select{|k,v| v.size % 2 != 0}.size | |
if count_chars_without_pair > 1 | |
0 | |
else | |
1 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment