by@n4o847
AC
817ms
#!perl -p /T/?$r=$':s/.$r/T\n/,s/K */K x length$&/e
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 KKKT