mirror of
https://github.com/TheAlgorithms/Ruby
synced 2024-12-27 21:58:57 +01:00
Update data_structures/hash_table/uncommon_words.rb
Co-authored-by: Vitor Oliveira <vbrazo@gmail.com>
This commit is contained in:
parent
a591b2fd56
commit
7f6b015a3b
1 changed files with 2 additions and 6 deletions
|
@ -29,11 +29,7 @@ def find_uncommon_words(strA, strB)
|
||||||
result = []
|
result = []
|
||||||
|
|
||||||
array.each do |word|
|
array.each do |word|
|
||||||
if hash[word]
|
|
||||||
hash[word] += 1
|
hash[word] += 1
|
||||||
else
|
|
||||||
hash[word] = 1
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
hash.each do |k, v|
|
hash.each do |k, v|
|
||||||
|
|
Loading…
Reference in a new issue