human
Count minimum swap to make string palindrome | Function to Count minimum swap.
Counter to count minimum swap.
A loop which run in half string from starting.
Left pointer.
Right pointer.
A loop which run from right pointer to left pointer.
if both char same then break the loop if not same then we have to move right pointer to one step left.
it denotes both pointer at same position and we don 't  have sufficient char to make  palindrome string.
Driver Code.
Length of string.
Function calling"
Solution in Python:
assistant
#Here is code to count minimum swap to make string palindrome and the other steps required.
 def CountSwap ( s , n ) :
	s = list ( s )
	count = 0
	ans = True
	for i in range ( n // 2 ) :
		left = i
		right = n - left - 1
		while left < right :
			if s [ left ] == s [ right ] :
				break
			else :
				right -= 1
		if left == right :
			ans = False
			break
		else :
			for j in range ( right , n - left - 1 ) :
				( s [ j ] , s [ j + 1 ] ) = ( s [ j + 1 ] , s [ j ] )
				count += 1
	if ans :
		return ( count )
	else :
		return - 1
s = ' geeksfgeeks '
n = len ( s )
ans1 = CountSwap ( s , n )
ans2 = CountSwap ( s [ : : - 1 ] , n )
print ( max ( ans1 , ans2 ) )