title: Transform one string to another string using BFS
body: <p><strong>There is a string whose characters can only be either ‘a’, ‘b’ or ‘$’, there is only one ‘$’ in the string.</strong> </p>
  
  <p>At each step, we can modify the string as follows:</p>
  
  <ol>
  <li><p>‘$’ can be swapped with its adjacent character, example “a$ba” can be changed to either “$aba” or “ab$a”.</p></li>
  <li><p>You can swap $ character with next to adjacent character only if adjacent character is different from next to adjacent character. (For example ‘aba$ab’ can be converted into ‘a$abab’ or ‘ababa$’, but ‘ab$aab’ cannot be converted to ‘abaa$b’, because ‘a’ cannot jump over ‘a’).</p></li>
  </ol>
  
  <p>You are given two strings, the initial state and the final state (lengths will be same), you have to output the minimum number of steps required to change the string in initial state to the string in the final state. </p>
  
  <p><strong>How to solve this problem using Breadth first search ?</strong><br/></p>
  
  <p>example:<br/>
  string s1 ,s2 ;<br/>
  input: s1 = a$b , s2 = ab$<br/>
  output: 1<br/>
  input: s1 = aba$a , s2 = $baaa<br/>
  output: 2<br/></p>