Use xor in part 2 of day 2.

This commit is contained in:
Danila Fedorin 2020-12-01 21:45:41 -08:00
parent d6aa267e8e
commit bcb7d535a4

View File

@ -30,7 +30,7 @@ def part2
min, max, char, str = data
min -= 1
max -= 1
((str[min] == char) || (str[max] == char) ) && str[min] != str[max]
(str[min] == char) ^ (str[max] == char)
end
puts total