Skip to content

Instantly share code, notes, and snippets.

@whatalnk
Created March 4, 2019 12:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whatalnk/32446ef539f355822ad0dadc3b3671ff to your computer and use it in GitHub Desktop.
Save whatalnk/32446ef539f355822ad0dadc3b3671ff to your computer and use it in GitHub Desktop.
AtCoder ABC #120 C. Unification
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