title: Number Substrings String
signature: numberSubstringsString(str) {
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(str, int expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(str), expected)){
              return "PASSED";
          }
          return "FAILED";
      }catch(exception_object){
          return exception_object.runtimeType.toString();
      }
  }
  
  int main() {
  
      print("TEST-0...${driver(
          "gZFGZsHCimLf", 
          78)
      }");
  
      print("TEST-1...${driver(
          "505357", 
          21)
      }");
  
      print("TEST-2...${driver(
          "011011101", 
          45)
      }");
  
      print("TEST-3...${driver(
          "ovfwP Osauz", 
          66)
      }");
  
      print("TEST-4...${driver(
          "92132238746026", 
          105)
      }");
  
      print("TEST-5...${driver(
          "01100", 
          15)
      }");
  
      print("TEST-6...${driver(
          "RaOWYQRfiWKSyC", 
          105)
      }");
  
      print("TEST-7...${driver(
          "861330202", 
          45)
      }");
  
      print("TEST-8...${driver(
          "001100010", 
          45)
      }");
  
      print("TEST-9...${driver(
          "uvpKlGUBLOMba", 
          91)
      }");
  
      return 0;
  }
source_py: def number_substrings_string(str):
      n = len(str)
      return int(((n * (n + 1)) / 2))
source_cpp: int number_substrings_string(string str) {
    int n = str . length ( );
    return n * ( n + 1 ) / 2;
  }