title: The shortest path between two integers by adding or subtracting
body: <p>Here's the description of this problem:</p>
  
  <blockquote>
    <p>You are given two integers a and b.  You want to find the shortest sequence of operations necessary to transform a into b, where at each step you are allowed to add or subtract 5, 7, or 12.</p>
  </blockquote>
  
  <p>For example, if you are given a = -5 and b = 19, the shortest path is</p>
  
  <pre><code>-5 + 12 + 12 = 19
  </code></pre>
  
  <p>If you were given 1 and 3, the shortest path would be</p>
  
  <pre><code>1 + 7 - 5 = 2
  </code></pre>
  
  <p>The only way I can think about solving this is using BFS and maybe some more pruning.  Is there a better algorithm I could use instead?</p>
  
  <p>Thanks!</p>