Skip to main content
added 8 characters in body
Source Link
fəˈnɛtɪk
  • 4.2k
  • 2
  • 16
  • 40

JavaScript ES6, 6161 59 bytes

Thanks @Luke for golfing off 68 bytes

x=>(a=[x=>[...x]).map((p,i,a)=>a[i]=/\d/.test(p)?a[i-1-p]:p).join``

Try it online!

JavaScript ES6, 61 bytes

Thanks @Luke for golfing off 6 bytes

x=>(a=[...x]).map((p,i)=>a[i]=/\d/.test(p)?a[i-1-p]:p).join``

Try it online!

JavaScript ES6, 61 59 bytes

Thanks @Luke for golfing off 8 bytes

x=>[...x].map((p,i,a)=>a[i]=/\d/.test(p)?a[i-1-p]:p).join``

Try it online!

Post Undeleted by fəˈnɛtɪk
added 201 characters in body
Source Link
fəˈnɛtɪk
  • 4.2k
  • 2
  • 16
  • 40

JavaScript ES6, 5861 bytes

Thanks @Luke for golfing off 6 bytes

x=>xx=>(a=[.split``..x]).map((p,i)=>=>a[i]=/[0-9]\d/.test(p)?x[ia[i-1-p]:p).join``

Try it online!Try it online!

JavaScript ES6, 58 bytes

x=>x.split``.map((p,i)=>/[0-9]/.test(p)?x[i-1-p]:p).join``

Try it online!

JavaScript ES6, 61 bytes

Thanks @Luke for golfing off 6 bytes

x=>(a=[...x]).map((p,i)=>a[i]=/\d/.test(p)?a[i-1-p]:p).join``

Try it online!

Post Deleted by fəˈnɛtɪk
Source Link
fəˈnɛtɪk
  • 4.2k
  • 2
  • 16
  • 40

JavaScript ES6, 58 bytes

x=>x.split``.map((p,i)=>/[0-9]/.test(p)?x[i-1-p]:p).join``

Try it online!