title: Check Occurrences Character Appear Together
signature: def checkOccurrencesCharacterAppearTogether(s: String, c: Char) = {
test_code: import scala.collection.mutable.HashMap
  import scala.collection.immutable.HashSet
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  
  // TESTING CODE 
  // ============================================
  def validateSolution(actual: Boolean , expected: Boolean): Boolean = {
      actual.toString == expected.toString
  }
  
  def driver(s: String, c: Char, expected: Boolean): String = {
      try {
          if (validateSolution(PLACEHOLDER_FN_NAME(s, c),expected)) {
              "PASSED"
          } else{
              "FAILED"
          }
      }catch{
          case e: Exception => {e.getClass.getName}
      }
  
  }
  object QuestionEvaluator extends App {
  
      println(s"TEST-0...${driver(
        "gILrzLimS", 'm', 
        true    
      )}")   
  
  
      println(s"TEST-1...${driver(
        "307471222", '2', 
        true    
      )}")   
  
  
      println(s"TEST-2...${driver(
        "110", '0', 
        true    
      )}")   
  
  
      println(s"TEST-3...${driver(
        "GcAB", 'v', 
        true    
      )}")   
  
  
      println(s"TEST-4...${driver(
        "113", '3', 
        true    
      )}")   
  
  
      println(s"TEST-5...${driver(
        "011110010", '0', 
        false    
      )}")   
  
  
      println(s"TEST-6...${driver(
        "wcwob", 'w', 
        false    
      )}")   
  
  
      println(s"TEST-7...${driver(
        "74571582216153", '1', 
        false    
      )}")   
  
  
      println(s"TEST-8...${driver(
        "100000011", '0', 
        true    
      )}")   
  
  
      println(s"TEST-9...${driver(
        "ryPErkzY", 'q', 
        true    
      )}")   
  
  }
  
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;
  }