title: Count Characters String Distance English Alphabets
signature: pub fn count_characters_string_distance_english_alphabets(str1: 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(str1: String, expected: i32)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(str1), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        "smnKL".to_string(), 
        2
      ));
      
      println!("TEST-1...{}", driver(
        "270083".to_string(), 
        3
      ));
      
      println!("TEST-2...{}", driver(
        "0".to_string(), 
        0
      ));
      
      println!("TEST-3...{}", driver(
        "kcZdsz".to_string(), 
        0
      ));
      
      println!("TEST-4...{}", driver(
        "483544224".to_string(), 
        7
      ));
      
      println!("TEST-5...{}", driver(
        "000011".to_string(), 
        1
      ));
      
      println!("TEST-6...{}", driver(
        "WysGCirMwKBzP".to_string(), 
        3
      ));
      
      println!("TEST-7...{}", driver(
        "3366".to_string(), 
        1
      ));
      
      println!("TEST-8...{}", driver(
        "110".to_string(), 
        1
      ));
      
      println!("TEST-9...{}", driver(
        "NlaMkpCjUgg".to_string(), 
        2
      ));
      
  }
source_py: def count_characters_string_distance_english_alphabets(str1):
      result = 0
      n = len(str1)
      for i in range(0, n):
          for j in range((i + 1), n):
              if (abs((ord(str1[i]) - ord(str1[j]))) == abs((i - j))):
                  result += 1
      return result
source_cpp: int count_characters_string_distance_english_alphabets(string str) {
    int result = 0;
    int n = str . length ( );
    for ( int i = 0;
    i < n;
    i ++ ) for ( int j = i + 1;
    j < n;
    j ++ ) if ( abs ( str [ i ] - str [ j ] ) == abs ( i - j ) ) result ++;
    return result;
  }