Created
April 17, 2019 11:07
-
-
Save whatalnk/2a9b44cd45e8e9964e327e8a4aa1114e to your computer and use it in GitHub Desktop.
AtCoder ABC #122 B - ATCoder
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 | |
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