by@paradigm_9
AC
2526ms
x=`dd`.split(' ')[..-2] x.map{|s|puts s.sub(x[0].index('T')||0,'T').sub(/K *T/){|y|"K"*y.size}}
T K
T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK
3+1 records in 3+1 records out 1581 bytes (1.6 kB, 1.5 KiB) copied, 9.3363e-05 s, 16.9 MB/s