title: Permutation of string as substring of another
body: <p>Given a string A and another string B. Find whether any permutation of B exists as a substring of A.</p>
  
  <p>For example,</p>
  
  <p>if A = "encyclopedia"</p>
  
  <p>if B="dep" then return true as ped is a permutation of dep and ped is a substring of A.</p>
  
  <pre><code>My solution-&gt;
  
  if length(A)=n and length(B)=m
  
  I did this in 0((n-m+1)*m) by sorting B and then checking A 
  with window size of m each time.
  </code></pre>
  
  <p>I need to find a better and a faster solution.</p>