by@drafear
AC
2032ms
f=fn s,i,j,f->case IO.getn(s,1)do :eof->a=1 t->f.((i==50||i*j>0)&&1||t,i<50&&"T"!=t&&i+1||0,t=="K"&&1||i*j,f)end end f.("",0,0,f)
T K
T 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 K1111111111111111111
warning: variable "a" is unused (if the variable is not meant to be used, prefix it with an underscore) /volume/CODE:2