by@dnek_
AC
1180ms
var x=0
while let l=readLine(){var s=""
l.map{x=$0>"S" ?0:$0>"J" ?x-49:(x+1)%50;s+="\(x<1 ?"x":$0)"}
print(s)} T
K
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
xxxxxxxxxxxxxxxxxxxxxxxxxx
/tmp/code.swift:3:3: warning: result of call to 'map' is unused
l.map{x=$0>"S" ?0:$0>"J" ?x-49:(x+1)%50;s+="\(x<1 ?"x":$0)"}
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~