title: Replace Character C1 C2 C2 C1 String S
signature: def replace_character_c1_c2_c2_c1_string_s(s, c1, c2):
test_code: import array
  import bisect
  import collections
  import datetime
  import functools
  import heapq
  import itertools
  import math
  import queue
  import re
  import string
  import sys
  from typing import Any, Dict, List, Optional, Set
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  def validate_solution(actual, expected):
      return actual == expected
  
  def driver(s, c1, c2, expected):
      try:
          if validate_solution(PLACEHOLDER_FN_NAME(
              s, c1, c2),
              expected
          ):
              return "PASSED"
          return "FAILED"
      except Exception as exception_obj:
          return type(exception_obj).__name__
      
  if __name__ == "__main__":
      result = driver("IZTSMw j", 'W', 'k', "IZTSMw j")
      print(f"TEST-0...{result}")
  
      result = driver("7288334", '6', '9', "7288334")
      print(f"TEST-1...{result}")
  
      result = driver("010110000", '1', '1', "010110000")
      print(f"TEST-2...{result}")
  
      result = driver("b gJX", 't', 'P', "b gJX")
      print(f"TEST-3...{result}")
  
      result = driver("734", '4', '4', "734")
      print(f"TEST-4...{result}")
  
      result = driver("1", '1', '1', "1")
      print(f"TEST-5...{result}")
  
      result = driver("xCaUKdhA", 'X', 'S', "xCaUKdhA")
      print(f"TEST-6...{result}")
  
      result = driver("4370992644981", '5', '6', "4370992544981")
      print(f"TEST-7...{result}")
  
      result = driver("01010", '0', '1', "10101")
      print(f"TEST-8...{result}")
  
      result = driver("ZNIFGshaWA", 'Q', 'x', "ZNIFGshaWA")
      print(f"TEST-9...{result}")
  
      sys.exit(0)
source_py: def replace_character_c1_c2_c2_c1_string_s(s, c1, c2):
      l = len(s)
      for i in range(l):
          if (s[i] == c1):
              s = ((s[0:i] + c2) + s[(i + 1):])
          elif (s[i] == c2):
              s = ((s[0:i] + c1) + s[(i + 1):])
      return s
source_cpp: string replace_character_c1_c2_c2_c1_string_s(string s, char c1, char c2) {
    int l = s . length ( );
    for ( int i = 0;
    i < l;
    i ++ ) {
      if ( s [ i ] == c1 ) s [ i ] = c2;
      else if ( s [ i ] == c2 ) s [ i ] = c1;
    }
    return s;
  }