title: Number Subsequences Form Ai Bj Ck
signature: numberSubsequencesFormAiBjCk :: String -> Integer
  numberSubsequencesFormAiBjCk s = 
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 :: Integer -> Integer -> Bool
  validateSolution actual expected = do
      actual == expected
  
  
  driver :: String -> Integer -> String
  driver s expected = do
      if (validateSolution (PLACEHOLDER_FN_NAME s) expected)
          then "PASSED"
      else "FAILED"
  
  main = do
      printf "TEST-0...%s\n" (driver ("") (0) )
  
      printf "TEST-1...%s\n" (driver ("abbc") (3) )
  
      printf "TEST-2...%s\n" (driver ("abcabc") (7) )
  
      printf "TEST-3...%s\n" (driver ("agsdbkfdc ") (1) )
  
      printf "TEST-4...%s\n" (driver ("ababab") (0) )
  
      printf "TEST-5...%s\n" (driver ("aaaaaaa") (0) )
  
      printf "TEST-6...%s\n" (driver ("aabaaabcc") (111) )
  
      printf "TEST-7...%s\n" (driver ("19") (0) )
  
      printf "TEST-8...%s\n" (driver ("1001100") (0) )
  
      printf "TEST-9...%s\n" (driver ("DtAnuQbU") (0) )
  
source_py: def number_subsequences_form_ai_bj_ck(s):
      aCount = 0
      bCount = 0
      cCount = 0
      for i in range(len(s)):
          if (s[i] == 'a'):
              aCount = (1 + (2 * aCount))
          elif (s[i] == 'b'):
              bCount = (aCount + (2 * bCount))
          elif (s[i] == 'c'):
              cCount = (bCount + (2 * cCount))
      return cCount
source_cpp: int number_subsequences_form_ai_bj_ck(string s) {
    int aCount = 0;
    int bCount = 0;
    int cCount = 0;
    for ( unsigned int i = 0;
    i < s . size ( );
    i ++ ) {
      if ( s [ i ] == 'a' ) aCount = ( 1 + 2 * aCount );
      else if ( s [ i ] == 'b' ) bCount = ( aCount + 2 * bCount );
      else if ( s [ i ] == 'c' ) cCount = ( bCount + 2 * cCount );
    }
    return cCount;
  }