title: Check String Follows Anbn Pattern Not
signature: checkStringFollowsAnbnPatternNot :: String -> Bool
  checkStringFollowsAnbnPatternNot str = 
test_code: import Text.Printf
  import Control.Exception (catch, SomeException)
  import Data.Typeable
  import qualified Data.List as List
  import qualified Data.Map as Map
  import qualified Data.Set as Set
  
  -- SOLUTION CODE
  -- ============================================
  
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  validateSolution :: Bool -> Bool -> Bool
  validateSolution actual expected = do
      actual == expected
  
  
  driver :: String -> Bool -> String
  driver str expected = do
      if (validateSolution (PLACEHOLDER_FN_NAME str) expected)
          then "PASSED"
      else "FAILED"
  
  main = do
      printf "TEST-0...%s\n" (driver ("ba") (False) )
  
      printf "TEST-1...%s\n" (driver ("aabb") (True) )
  
      printf "TEST-2...%s\n" (driver ("abab") (False) )
  
      printf "TEST-3...%s\n" (driver ("aaabb") (False) )
  
      printf "TEST-4...%s\n" (driver ("aabbb") (False) )
  
      printf "TEST-5...%s\n" (driver ("abaabbaa") (False) )
  
      printf "TEST-6...%s\n" (driver ("abaababb") (False) )
  
      printf "TEST-7...%s\n" (driver ("bbaa") (False) )
  
      printf "TEST-8...%s\n" (driver ("11001000") (False) )
  
      printf "TEST-9...%s\n" (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;
  }