title: find minimum steps required to change one binary string to another
body: <blockquote>
  <p>Given two string str1 and str2 which contain only <code>0</code> or <code>1</code>, there
  are some steps to change str1 to str2,</p>
  <p>step1: find a substring of str1 of length 2 and reverse the substring, and str1 becomes str1' (str1' != str1)</p>
  <p>step2: find a substring of str1' of length 3, and reverse the substring, and str1' becomes str1'' (str1'' != str1')</p>
  <p>the following steps are similar.</p>
  <p>the string length is in the range [2, 30]</p>
  <p><strong>Requirement</strong>: each step must be performed once and we can not skip
  previous steps and perform the next step.</p>
  <p>If it is possible to change str1 to str2, output the minimum steps required, otherwise, output -1</p>
  </blockquote>
  <h2>Example 1</h2>
  <blockquote>
  <p>str1 = &quot;1010&quot;, str2 = &quot;0011&quot;, the minimum step required is 2</p>
  <p>first, choose substring in range [2, 3], &quot;1010&quot; --&gt; &quot;1001&quot;,</p>
  <p>then choose substring in the range [0, 2], &quot;1001&quot; --&gt; &quot;0011&quot;</p>
  </blockquote>
  <h2>Example 2</h2>
  <blockquote>
  <p>str1 = &quot;1001&quot;, str2 = &quot;0110&quot;, it is impossible to change str1 to str2,
  because in step1, str1 can be changed to &quot;0101&quot; or &quot;1010&quot;, but in step3, it is impossible to change a length3 substring to make it different. So the output is -1.</p>
  </blockquote>
  <h2>Example 3</h2>
  <blockquote>
  <p>str1 = &quot;10101010&quot;, str2 = &quot;00101011&quot;， output is 7</p>
  </blockquote>
  <p>I can not figure out example 3, because there are two many possibilities. Can anyone gives some hint on how to solve this problem? What is the type of this
  problem? Is it dynamic programming?</p>