by@k_hanazuki
AC
990ms
s=`dd`;puts s.gsub(/^.{#{s=~/T/}}\K /,?T).sub(/K */){?K*$&.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 KKKKKKKKT
4+1 records in 4+1 records out