title: Replace Character C1 C2 C2 C1 String S
signature: replaceCharacterC1C2C2C1StringS(s, c1, c2) {
test_code: import 'dart:convert';
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  bool validateSolution(String actual, String expected){
      return actual.toString() == expected.toString();
  }
  
  String driver(s, c1, c2, String expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(s, c1, c2), expected)){
              return "PASSED";
          }
          return "FAILED";
      }catch(exception_object){
          return exception_object.runtimeType.toString();
      }
  }
  
  int main() {
  
      print("TEST-0...${driver(
          "IZTSMw j", 'W', 'k', 
          "IZTSMw j")
      }");
  
      print("TEST-1...${driver(
          "7288334", '6', '9', 
          "7288334")
      }");
  
      print("TEST-2...${driver(
          "010110000", '1', '1', 
          "010110000")
      }");
  
      print("TEST-3...${driver(
          "b gJX", 't', 'P', 
          "b gJX")
      }");
  
      print("TEST-4...${driver(
          "734", '4', '4', 
          "734")
      }");
  
      print("TEST-5...${driver(
          "1", '1', '1', 
          "1")
      }");
  
      print("TEST-6...${driver(
          "xCaUKdhA", 'X', 'S', 
          "xCaUKdhA")
      }");
  
      print("TEST-7...${driver(
          "4370992644981", '5', '6', 
          "4370992544981")
      }");
  
      print("TEST-8...${driver(
          "01010", '0', '1', 
          "10101")
      }");
  
      print("TEST-9...${driver(
          "ZNIFGshaWA", 'Q', 'x', 
          "ZNIFGshaWA")
      }");
  
      return 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;
  }