title: Replace Character C1 C2 C2 C1 String S
signature: fun replaceCharacterC1C2C2C1StringS(s: String, c1: Char, c2: Char): 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;
  }
question_info.test_list: [{"idx": 0, "outputs": "IZTSMw j", "inputs": {"s": "IZTSMw j", "c1": "W", "c2": "k"}}, {"idx": 1, "outputs": "7288334", "inputs": {"s": "7288334", "c1": "6", "c2": "9"}}, {"idx": 2, "outputs": "010110000", "inputs": {"s": "010110000", "c1": "1", "c2": "1"}}, {"idx": 3, "outputs": "b gJX", "inputs": {"s": "b gJX", "c1": "t", "c2": "P"}}, {"idx": 4, "outputs": "734", "inputs": {"s": "734", "c1": "4", "c2": "4"}}, {"idx": 5, "outputs": "1", "inputs": {"s": "1", "c1": "1", "c2": "1"}}, {"idx": 6, "outputs": "xCaUKdhA", "inputs": {"s": "xCaUKdhA", "c1": "X", "c2": "S"}}, {"idx": 7, "outputs": "4370992544981", "inputs": {"s": "4370992644981", "c1": "5", "c2": "6"}}, {"idx": 8, "outputs": "10101", "inputs": {"s": "01010", "c1": "0", "c2": "1"}}, {"idx": 9, "outputs": "ZNIFGshaWA", "inputs": {"s": "ZNIFGshaWA", "c1": "Q", "c2": "x"}}]
question_info.extension: kts
question_info.test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:String, expected:String):Boolean{
    return actual.equals(expected)
  }
  fun driver(s: String, c1: Char, c2: Char, expected:String):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(s, c1, c2), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver("IZTSMw j", 'W', 'k', "IZTSMw j")
      println("TEST-0...${result}")
      
      result = driver("7288334", '6', '9', "7288334")
      println("TEST-1...${result}")
      
      result = driver("010110000", '1', '1', "010110000")
      println("TEST-2...${result}")
      
      result = driver("b gJX", 't', 'P', "b gJX")
      println("TEST-3...${result}")
      
      result = driver("734", '4', '4', "734")
      println("TEST-4...${result}")
      
      result = driver("1", '1', '1', "1")
      println("TEST-5...${result}")
      
      result = driver("xCaUKdhA", 'X', 'S', "xCaUKdhA")
      println("TEST-6...${result}")
      
      result = driver("4370992644981", '5', '6', "4370992544981")
      println("TEST-7...${result}")
      
      result = driver("01010", '0', '1', "10101")
      println("TEST-8...${result}")
      
      result = driver("ZNIFGshaWA", 'Q', 'x', "ZNIFGshaWA")
      println("TEST-9...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: replaceCharacterC1C2C2C1StringS
question_info.entry_cls_name: Solution
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: kotlinc -script __FILENAME__ -no-reflect -nowarn