title: Check String Follows Anbn Pattern Not
signature: def checkStringFollowsAnbnPatternNot(str: String) = {
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(str: String, expected: Boolean): String = {
      try {
          if (validateSolution(PLACEHOLDER_FN_NAME(str),expected)) {
              "PASSED"
          } else{
              "FAILED"
          }
      }catch{
          case e: Exception => {e.getClass.getName}
      }
  
  }
  object QuestionEvaluator extends App {
  
      println(s"TEST-0...${driver(
        "ba", 
        false    
      )}")   
  
  
      println(s"TEST-1...${driver(
        "aabb", 
        true    
      )}")   
  
  
      println(s"TEST-2...${driver(
        "abab", 
        false    
      )}")   
  
  
      println(s"TEST-3...${driver(
        "aaabb", 
        false    
      )}")   
  
  
      println(s"TEST-4...${driver(
        "aabbb", 
        false    
      )}")   
  
  
      println(s"TEST-5...${driver(
        "abaabbaa", 
        false    
      )}")   
  
  
      println(s"TEST-6...${driver(
        "abaababb", 
        false    
      )}")   
  
  
      println(s"TEST-7...${driver(
        "bbaa", 
        false    
      )}")   
  
  
      println(s"TEST-8...${driver(
        "11001000", 
        false    
      )}")   
  
  
      println(s"TEST-9...${driver(
        "ZWXv te", 
        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;
  }