Skip to content

Commit 82254a6

Browse files
committed
Day 2 - corrected Ruby solution
1 parent 7952ca4 commit 82254a6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

02/solution.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# First part
66
c = data.map{|row| row.split("")}
7-
.map{|row| row.uniq.map{ |char| row.count(char) if row.count(char)!=1 }.compact.uniq}
7+
.map{|row| row.uniq.map{ |char| row.count(char) if [2, 3].include? row.count(char) }.compact.uniq}
88
.reduce([], :concat)
99

1010
puts "First part: " + c.uniq

0 commit comments

Comments
 (0)