Skip to main content
2 of 2
-10B thanks to @Neil
Jiří
  • 1.9k
  • 8
  • 21

sed -E, 131 121 bytes

-10B thanks to @Neil

s/./X&/g
s/X([0-7])/ \1/g
y/89ABCDEF/01234567/
s/[4-7]/X&/g
s/[0-3]/ &/g
s/[2367]/X&/g
s/[0145]/ &/g
y/01234567/ X X X X/

Attempt This Online!

Jiří
  • 1.9k
  • 8
  • 21