#K4, 22 21 bytes
K4, 22 21 bytes
Solution:
"c"$2/:'0N 8#?/0 2_x:
Example:
q)k)"c"$2/:'0N 8#?/0 2_x:"ABAABBAAAAAABBAAABAABBAABA"
"012"
Explanation:
Evaluated right-to-left:
"c"$2/:'0N 8#?/0 2_x: / the solution
x: / save input as x
0 2_ / cut x at 0 and 2nd index
?/ / lookup (?) over (/)
0N 8# / reshape into 8-long rows
2/:' / decode (/:) each (') from base 2
"c"$ / cast to character
Notes:
- -1 byte thanks to ngn!