Amazon interview question

implement Hoffman compression