title: Replace Character C1 C2 C2 C1 String S
signature: pub fn replace_character_c1_c2_c2_c1_string_s(s: String, c1: char, c2: char) -> String {
test_code: use std::collections::HashMap;
  use std::collections::HashSet;
  use std::cmp::*;
  use std::collections::*;
  use std::fmt::*; 
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  pub fn validate_solution(actual: String, expected: String)->bool{
  return actual==expected
  }
  pub fn driver(s: String, c1: char, c2: char, expected: String)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(s, c1, c2), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        "IZTSMw j".to_string(), 'W', 'k', 
        "IZTSMw j".to_string()
      ));
      
      println!("TEST-1...{}", driver(
        "7288334".to_string(), '6', '9', 
        "7288334".to_string()
      ));
      
      println!("TEST-2...{}", driver(
        "010110000".to_string(), '1', '1', 
        "010110000".to_string()
      ));
      
      println!("TEST-3...{}", driver(
        "b gJX".to_string(), 't', 'P', 
        "b gJX".to_string()
      ));
      
      println!("TEST-4...{}", driver(
        "734".to_string(), '4', '4', 
        "734".to_string()
      ));
      
      println!("TEST-5...{}", driver(
        "1".to_string(), '1', '1', 
        "1".to_string()
      ));
      
      println!("TEST-6...{}", driver(
        "xCaUKdhA".to_string(), 'X', 'S', 
        "xCaUKdhA".to_string()
      ));
      
      println!("TEST-7...{}", driver(
        "4370992644981".to_string(), '5', '6', 
        "4370992544981".to_string()
      ));
      
      println!("TEST-8...{}", driver(
        "01010".to_string(), '0', '1', 
        "10101".to_string()
      ));
      
      println!("TEST-9...{}", driver(
        "ZNIFGshaWA".to_string(), 'Q', 'x', 
        "ZNIFGshaWA".to_string()
      ));
      
  }
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;
  }