title: Number Subsequences Form Ai Bj Ck
signature: numberSubsequencesFormAiBjCk(s) {
test_code: import 'dart:convert';
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  bool validateSolution(int actual, int expected){
      return actual.toString() == expected.toString();
  }
  
  String driver(s, int expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(s), expected)){
              return "PASSED";
          }
          return "FAILED";
      }catch(exception_object){
          return exception_object.runtimeType.toString();
      }
  }
  
  int main() {
  
      print("TEST-0...${driver(
          "", 
          0)
      }");
  
      print("TEST-1...${driver(
          "abbc", 
          3)
      }");
  
      print("TEST-2...${driver(
          "abcabc", 
          7)
      }");
  
      print("TEST-3...${driver(
          "agsdbkfdc ", 
          1)
      }");
  
      print("TEST-4...${driver(
          "ababab", 
          0)
      }");
  
      print("TEST-5...${driver(
          "aaaaaaa", 
          0)
      }");
  
      print("TEST-6...${driver(
          "aabaaabcc", 
          111)
      }");
  
      print("TEST-7...${driver(
          "19", 
          0)
      }");
  
      print("TEST-8...${driver(
          "1001100", 
          0)
      }");
  
      print("TEST-9...${driver(
          "DtAnuQbU", 
          0)
      }");
  
      return 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;
  }