by@paradigm_9
AC
2731ms
x=`dd`.split ' ' x[..-2].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 T T T T T T T T T T T T T T T T T T KKKKKKK
4+1 records in 4+1 records out 2499 bytes (2.5 kB, 2.4 KiB) copied, 6.1571e-05 s, 40.6 MB/s