Skip to content

Instantly share code, notes, and snippets.

@oleglukashev
Created April 26, 2015 14:56
Show Gist options
  • Save oleglukashev/6af90684dfbc42bb87b9 to your computer and use it in GitHub Desktop.
Save oleglukashev/6af90684dfbc42bb87b9 to your computer and use it in GitHub Desktop.
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