Skip to main content
2 of 2
Commonmark migration

MATLAB, 60 bytes

@(y)[arrayfun(@(x)bin2dec([97-fliplr(dec2bin(x)) '']),y) ''] 

Basically each character in turn is converted into a binary string (with no leading zeros). The array is flipped and is subtracted from 97 ('0'+'1') which inverts the character. This is converted back to decimal. After all characters have been processed, the whole array is then converted back to characters before being returned.

Tom Carpenter
  • 4.3k
  • 14
  • 21