title: Minimum number of swaps to convert a string to palindrome
body: <p>We are given a string and we have to find out the minimum number of swaps to convert it into a palindrome. </p>
  
  <pre><code>Ex-
  Given string: ntiin
  Palindrome: nitin
  Minimum number of swaps: 1
  </code></pre>
  
  <p>If it is not possible to convert it into a palindrome, return <code>-1</code>.</p>
  
  <p>I am unable to think of any approach except <code>brute force</code>. We can check on the first and last characters, if they are equal, we check for the smaller substring, and then apply brute force on it. But this will be of a very high complexity, and I feel this question can be solved in another way. Maybe <code>dynamic programming</code>. How to approach it?</p>