input: def smallest_string_by_swapping(s: str) -> str:
      """
      Given a string s composed only of digits, return the lexicographically smallest string
      that can be produced by swapping adjacent digits in s with the same parity one time.
  
      Digits are considered to have the same parity if they are both odd or both even. For example, 3 and 7, as well as 4 and 6, share the same parity, while 5 and 8 do not.
  
      Examples:
      >>> s = "45320"
      "43520"
      >>> s = "001"
      "001"
  
      Constraints:
      2 <= s.length <= 100
      s consists solely of digits.
      """
output:     
      even_digits = [c for c in s if int(c) % 2 == 0]
      odd_digits = [c for c in s if int(c) % 2 != 0]
  
      even_digits.sort()
      odd_digits.sort()
  
      result = []
      for c in s:
          if int(c) % 2 == 0:
              result.append(even_digits.pop(0))
          else:
              result.append(odd_digits.pop(0))
  
      return ''.join(result)
  