title: Number Substrings String
signature: pub fn number_substrings_string(str: String) -> i32 {
test_code: use std::collections::HashMap;
  use std::collections::HashSet;
  use std::cmp::*;
  use std::collections::*;
  use std::fmt::*; 
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  pub fn validate_solution(actual: i32, expected: i32)->bool{
  return actual==expected
  }
  pub fn driver(str: String, expected: i32)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(str), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        "gZFGZsHCimLf".to_string(), 
        78
      ));
      
      println!("TEST-1...{}", driver(
        "505357".to_string(), 
        21
      ));
      
      println!("TEST-2...{}", driver(
        "011011101".to_string(), 
        45
      ));
      
      println!("TEST-3...{}", driver(
        "ovfwP Osauz".to_string(), 
        66
      ));
      
      println!("TEST-4...{}", driver(
        "92132238746026".to_string(), 
        105
      ));
      
      println!("TEST-5...{}", driver(
        "01100".to_string(), 
        15
      ));
      
      println!("TEST-6...{}", driver(
        "RaOWYQRfiWKSyC".to_string(), 
        105
      ));
      
      println!("TEST-7...{}", driver(
        "861330202".to_string(), 
        45
      ));
      
      println!("TEST-8...{}", driver(
        "001100010".to_string(), 
        45
      ));
      
      println!("TEST-9...{}", driver(
        "uvpKlGUBLOMba".to_string(), 
        91
      ));
      
  }
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;
  }