by@pizzacat83a
WA
899ms
give s p=substr(s,"T") while 1 give s for i=1 to p see" "next ?1 q=substr(s,"K") if q for i=1 to q see" "next for i=0 to p-q see 1 next exit ok end
T K
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 1111111111