by@k_hanazuki
AC
1011ms
linesĀ».&{($=$_~|($ //=$_))~~{1 while s/k\s/kk/;.say}}
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 kkkkkkkkkkkkkkkkkkkkt
WARNINGS for /volume/CODE: Useless use of constant integer 1 in sink context (use Nil instead to suppress this warning) (line 1)