Skip to main content
3 of 3
shorter yet
chunes
  • 27.8k
  • 3
  • 32
  • 55

Factor, 50 46 41 bytes

[ [ >bin reverse 97 v-n vneg bin> ] map ] 

Try it online!

-4 bytes thanks to @Bubbler! -5 bytes thanks to @Bubbler!

Even though removing control characters is just [ control? ] reject it's not worth the 15% discount.

  • [ ... ] map Map over the code points in the input string.
  • >bin Convert a code point to a binary string.
  • reverse Reverse it.
  • 97 v-n vneg Invert the string (1s become 0s and vice-versa).
  • bin> Convert from a binary string to decimal.
chunes
  • 27.8k
  • 3
  • 32
  • 55