The message is rewritten by replacing each symbol with its code.
Rewrite each symbol
The pinned message is ABACAD. The encoder replaces each symbol with its code.
message is ABACAD
Follow the message order
ABACAD becomes A, B, A, C, A, D, so the code pieces are 1, 00, 1, 010, 1, 011.
A,B,A,C,A,D
Join the pieces
Joining those pieces gives encoded bitstring 10010101011.
encoded=10010101011
Summary
The encoded string is recomputed from the counts, the deterministic merge rule, and message ABACAD.
encoded=10010101011