title: Replace Character C1 C2 C2 C1 String S
signature: func replaceCharacterC1C2C2C1StringS(s string, c1 rune, c2 rune) string {
test_code: package main
  
  import (
      "fmt"
      "reflect"
      "math"
      "sort"
  )
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  func validateSolution(actual string, expected string) bool {
      return reflect.DeepEqual(actual,expected)
  }
  
  func driver(s string, c1 rune, c2 rune, expected string) string {
      if validateSolution(PLACEHOLDER_FN_NAME(s, c1, c2),expected) {
              return "PASSED"
      }
      return "FAILED"
  
  }
  
  func main() {
  
      // Use imports to avoid undefined errors
      var _ = reflect.DeepEqual
      _ = math.Abs
      _ = sort.Sort
      result := ""
      result = driver("IZTSMw j", 
  	'W', 
  	'k', "IZTSMw j")
      fmt.Printf("TEST-0...%s\n", result)
      
      result = driver("7288334", 
  	'6', 
  	'9', "7288334")
      fmt.Printf("TEST-1...%s\n", result)
      
      result = driver("010110000", 
  	'1', 
  	'1', "010110000")
      fmt.Printf("TEST-2...%s\n", result)
      
      result = driver("b gJX", 
  	't', 
  	'P', "b gJX")
      fmt.Printf("TEST-3...%s\n", result)
      
      result = driver("734", 
  	'4', 
  	'4', "734")
      fmt.Printf("TEST-4...%s\n", result)
      
      result = driver("1", 
  	'1', 
  	'1', "1")
      fmt.Printf("TEST-5...%s\n", result)
      
      result = driver("xCaUKdhA", 
  	'X', 
  	'S', "xCaUKdhA")
      fmt.Printf("TEST-6...%s\n", result)
      
      result = driver("4370992644981", 
  	'5', 
  	'6', "4370992544981")
      fmt.Printf("TEST-7...%s\n", result)
      
      result = driver("01010", 
  	'0', 
  	'1', "10101")
      fmt.Printf("TEST-8...%s\n", result)
      
      result = driver("ZNIFGshaWA", 
  	'Q', 
  	'x', "ZNIFGshaWA")
      fmt.Printf("TEST-9...%s\n", result)
      
          
  }
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;
  }