Skip to content

Instantly share code, notes, and snippets.

@whatalnk
Created April 17, 2019 11:07
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/2a9b44cd45e8e9964e327e8a4aa1114e to your computer and use it in GitHub Desktop.
Save whatalnk/2a9b44cd45e8e9964e327e8a4aa1114e to your computer and use it in GitHub Desktop.
AtCoder ABC #122 B - ATCoder
s = gets.chomp
n = s.length
base = ["A", "G", "C", "T"]
ans = 0
cur = 0
n.times do |i|
if base.include?(s[i])
cur += 1
else
ans = [ans, cur].max
cur = 0
end
end
ans = [ans, cur].max
puts ans
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment