Amazon Interview Question

implement Hoffman compression