Created
March 4, 2019 12:50
-
-
Save whatalnk/32446ef539f355822ad0dadc3b3671ff to your computer and use it in GitHub Desktop.
AtCoder ABC #120 C. Unification
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
s = gets.chomp.split("").map(&:to_i) | |
a = 0 | |
b = 0 | |
s.each do |i| | |
if i == 0 | |
a += 1 | |
else | |
b += 1 | |
end | |
end | |
puts [a, b].min * 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment