title: Lempel-Ziv encoding - split string
body: <p>I have given string 1100011110000011111000000. I have to encode it by Basic Lempel-Ziv algorithm. I know how to do it. The problem is two first numbers are 1. I parse it into anordered dictionary of substrings. So result is:</p>
  
  <p>1, 10, 0, 01, 11, 100, 00, 011, 111, 000</p>
  
  <p>I want to number new substring, but then 1=No.1, 10=No.2 and 0=No.3., that means, I cant encode substring 10, because here is not value of 0.</p>
  
  <p>Another problem is - at the end here are three 0 more, but I have one substring 000. What I have to do with last 000?</p>
  
  <p>So, is there any different way to parse the sting in substrings?</p>