title: Check Occurrences Character Appear Together
signature: pub fn check_occurrences_character_appear_together(s: String, c: char) -> bool {
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: bool, expected: bool)->bool{
  return actual==expected
  }
  pub fn driver(s: String, c: char, expected: bool)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(s, c), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        "gILrzLimS".to_string(), 'm', 
        true
      ));
      
      println!("TEST-1...{}", driver(
        "307471222".to_string(), '2', 
        true
      ));
      
      println!("TEST-2...{}", driver(
        "110".to_string(), '0', 
        true
      ));
      
      println!("TEST-3...{}", driver(
        "GcAB".to_string(), 'v', 
        true
      ));
      
      println!("TEST-4...{}", driver(
        "113".to_string(), '3', 
        true
      ));
      
      println!("TEST-5...{}", driver(
        "011110010".to_string(), '0', 
        false
      ));
      
      println!("TEST-6...{}", driver(
        "wcwob".to_string(), 'w', 
        false
      ));
      
      println!("TEST-7...{}", driver(
        "74571582216153".to_string(), '1', 
        false
      ));
      
      println!("TEST-8...{}", driver(
        "100000011".to_string(), '0', 
        true
      ));
      
      println!("TEST-9...{}", driver(
        "ryPErkzY".to_string(), '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;
  }