Driver code
public static void Main ( ) { String str = " abbaacb " ; int n = str . Length , cnt = 0 , minm = int . MaxValue ; Console . WriteLine ( minSwaps ( str . ToCharArray ( ) , 0 , n - 1 , cnt , minm ) ) ; ; } }