title: Check Occurrences Character Appear Together
signature: fun checkOccurrencesCharacterAppearTogether(s: String, c: Char): Boolean {
source_py: def check_occurrences_character_appear_together(s, c):
      oneSeen = False
      i = 0
      n = len(s)
      while (i < n):
          if (s[i] == c):
              if (oneSeen == True):
                  return False
              while ((i < n) and (s[i] == c)):
                  i = (i + 1)
              oneSeen = True
          else:
              i = (i + 1)
      return True
source_cpp: bool check_occurrences_character_appear_together(string s, char c) {
    bool oneSeen = false;
    int i = 0, n = s . length ( );
    while ( i < n ) {
      if ( s [ i ] == c ) {
        if ( oneSeen == true ) return false;
        while ( i < n && s [ i ] == c ) i ++;
        oneSeen = true;
      }
      else i ++;
    }
    return true;
  }
question_info.test_list: [{"idx": 0, "outputs": true, "inputs": {"s": "gILrzLimS", "c": "m"}}, {"idx": 1, "outputs": true, "inputs": {"s": "307471222", "c": "2"}}, {"idx": 2, "outputs": true, "inputs": {"s": "110", "c": "0"}}, {"idx": 3, "outputs": true, "inputs": {"s": "GcAB", "c": "v"}}, {"idx": 4, "outputs": true, "inputs": {"s": "113", "c": "3"}}, {"idx": 5, "outputs": false, "inputs": {"s": "011110010", "c": "0"}}, {"idx": 6, "outputs": false, "inputs": {"s": "wcwob", "c": "w"}}, {"idx": 7, "outputs": false, "inputs": {"s": "74571582216153", "c": "1"}}, {"idx": 8, "outputs": true, "inputs": {"s": "100000011", "c": "0"}}, {"idx": 9, "outputs": true, "inputs": {"s": "ryPErkzY", "c": "q"}}]
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:Boolean, expected:Boolean):Boolean{
    return actual.equals(expected)
  }
  fun driver(s: String, c: Char, expected:Boolean):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(s, c), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver("gILrzLimS", 'm', true)
      println("TEST-0...${result}")
      
      result = driver("307471222", '2', true)
      println("TEST-1...${result}")
      
      result = driver("110", '0', true)
      println("TEST-2...${result}")
      
      result = driver("GcAB", 'v', true)
      println("TEST-3...${result}")
      
      result = driver("113", '3', true)
      println("TEST-4...${result}")
      
      result = driver("011110010", '0', false)
      println("TEST-5...${result}")
      
      result = driver("wcwob", 'w', false)
      println("TEST-6...${result}")
      
      result = driver("74571582216153", '1', false)
      println("TEST-7...${result}")
      
      result = driver("100000011", '0', true)
      println("TEST-8...${result}")
      
      result = driver("ryPErkzY", 'q', true)
      println("TEST-9...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: checkOccurrencesCharacterAppearTogether
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