title: variations in huffman encoding codewords
body: <p>I'm trying to solve some huffman coding problems, but I always get different values for the codewords (values not lengths).
  for example, if the codeword of character 'c' was 100, in my solution it is 101.</p>
  
  <p>Here is an example:</p>
  
  <pre>
  Character    Frequency   codeword    my solution
     A            22          00          10
     B            12          100         010
     C            24          01          11
     D            6           1010        0110
     E            27          11          00
     F            9           1011        0111
  </pre>
  
  <p>Both solutions have the same length for codewords, and there is no codeword that is prefix of another codeword.</p>
  
  <p>Does this make my solution valid ? or it has to be only 2 solutions, the optimal one and flipping the bits of the optimal one ?</p>