Task: | ABC-poisto |
Sender: | hltk |
Submission time: | 2020-10-19 22:10:06 +0300 |
Language: | Ruby |
Status: | READY |
Result: | 100 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 42 |
#2 | ACCEPTED | 58 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | ACCEPTED | 0.07 s | 1, 2 | details |
#2 | ACCEPTED | 0.07 s | 2 | details |
Code
gets.to_i.times do s = gets.strip m = s.chars.uniq.map { |c| s.count c }.max n = s.length puts m*2 <= n ? n-n%2 : (n-m)*2 end