by@n4o847
AC
682ms
t+=index($0,"T"){for($0=substr($0,1,t-1)"T";sub(/K /,"KK"););}1
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 KKKKKKKKKKKKKKT