Created
January 5, 2017 22:23
-
-
Save kossgreim/61b653402f526a389ba39eef93ba1f62 to your computer and use it in GitHub Desktop.
Uloha PR1 - zkouska
This file contains 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
arr = %w(a ba ca) | |
letters = arr[0].split('').uniq | |
letters.length.times do |i| | |
arr.slice(1, arr.length).each do |word| | |
letters.delete(letters[i]) if letters[i] && !word.include?(letters[i]) | |
end | |
end | |
puts "pismena: #{letters.join(', ')}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment