title: Number Subsequences Form Ai Bj Ck
signature: func numberSubsequencesFormAiBjCk(s string) int {
test_code: package main
  
  import (
      "fmt"
      "reflect"
      "math"
      "sort"
  )
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  func validateSolution(actual int, expected int) bool {
      return reflect.DeepEqual(actual,expected)
  }
  
  func driver(s string, expected int) string {
      if validateSolution(PLACEHOLDER_FN_NAME(s),expected) {
              return "PASSED"
      }
      return "FAILED"
  
  }
  
  func main() {
  
      // Use imports to avoid undefined errors
      var _ = reflect.DeepEqual
      _ = math.Abs
      _ = sort.Sort
      result := ""
      result = driver("", 0)
      fmt.Printf("TEST-0...%s\n", result)
      
      result = driver("abbc", 3)
      fmt.Printf("TEST-1...%s\n", result)
      
      result = driver("abcabc", 7)
      fmt.Printf("TEST-2...%s\n", result)
      
      result = driver("agsdbkfdc ", 1)
      fmt.Printf("TEST-3...%s\n", result)
      
      result = driver("ababab", 0)
      fmt.Printf("TEST-4...%s\n", result)
      
      result = driver("aaaaaaa", 0)
      fmt.Printf("TEST-5...%s\n", result)
      
      result = driver("aabaaabcc", 111)
      fmt.Printf("TEST-6...%s\n", result)
      
      result = driver("19", 0)
      fmt.Printf("TEST-7...%s\n", result)
      
      result = driver("1001100", 0)
      fmt.Printf("TEST-8...%s\n", result)
      
      result = driver("DtAnuQbU", 0)
      fmt.Printf("TEST-9...%s\n", result)
      
          
  }
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;
  }