title: Check String Follows Anbn Pattern Not
signature: pub fn check_string_follows_anbn_pattern_not(str: String) -> 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(str: String, expected: bool)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(str), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        "ba".to_string(), 
        false
      ));
      
      println!("TEST-1...{}", driver(
        "aabb".to_string(), 
        true
      ));
      
      println!("TEST-2...{}", driver(
        "abab".to_string(), 
        false
      ));
      
      println!("TEST-3...{}", driver(
        "aaabb".to_string(), 
        false
      ));
      
      println!("TEST-4...{}", driver(
        "aabbb".to_string(), 
        false
      ));
      
      println!("TEST-5...{}", driver(
        "abaabbaa".to_string(), 
        false
      ));
      
      println!("TEST-6...{}", driver(
        "abaababb".to_string(), 
        false
      ));
      
      println!("TEST-7...{}", driver(
        "bbaa".to_string(), 
        false
      ));
      
      println!("TEST-8...{}", driver(
        "11001000".to_string(), 
        false
      ));
      
      println!("TEST-9...{}", driver(
        "ZWXv te".to_string(), 
        false
      ));
      
  }
source_py: def check_string_follows_anbn_pattern_not(str):
      n = len(str)
      for i in range(n):
          if (str[i] != 'a'):
              break
      if ((i * 2) != n):
          return False
      for j in range(i, n):
          if (str[j] != 'b'):
              return False
      return True
source_cpp: bool check_string_follows_anbn_pattern_not(string str) {
    int n = str . length ( );
    int i;
    for ( i = 0;
    i < n;
    i ++ ) if ( str [ i ] != 'a' ) break;
    if ( i * 2 != n ) return false;
    int j;
    for ( j = i;
    j < n;
    j ++ ) if ( str [ j ] != 'b' ) return false;
    return true;
  }