comefrom: <doocs>2193.Minimum Number of Moves to Make Palindrome_1.py
code: def minMovesToMakePalindrome( s: str) -> int:
      cs = list(s)
      ans, n = 0, len(s)
      i, j = 0, n - 1
      while i < j:
          even = False
          for k in range(j, i, -1):
              if cs[i] == cs[k]:
                  even = True
                  while k < j:
                      cs[k], cs[k + 1] = cs[k + 1], cs[k]
                      k += 1
                      ans += 1
                  j -= 1
                  break
          if not even:
              ans += n // 2 - i
          i += 1
      return ans
masked: def sample_funcname ( var_0 : str ) -> int :
      var_4 = list ( var_0 )
      var_6 , var_8 = 0 , len ( var_0 )
      var_9 , var_11 = 0 , var_8 - 1
      while var_9 < var_11 :
          var_13 = False
          for var_15 in range ( var_11 , var_9 , - 1 ) :
              if var_4 [ var_9 ] == var_4 [ var_15 ] :
                  var_13 = True
                  while var_15 < var_11 :
                      var_4 [ var_15 ] , var_4 [ var_15 + 1 ] = var_4 [ var_15 + 1 ] , var_4 [ var_15 ]
                      var_15 += 1
                      var_6 += 1
                  var_11 -= 1
                  break
          if not var_13 :
              var_6 += var_8 // 2 - var_9
          var_9 += 1
      return var_6
  