So first, some terminology.
A uniquely decodable code is a code where every string has at most one decoding.
A prefix code is a code where no code word is a prefix of any other. This is an interesting property because it means that the system is uniquely decodable without using lookahead.
A uniquely decodable code is optimal if it has minimal average code ...