title: Count Characters String Distance English Alphabets
signature: def countCharactersStringDistanceEnglishAlphabets(str1: String) = {
test_code: import scala.collection.mutable.HashMap
  import scala.collection.immutable.HashSet
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  
  // TESTING CODE 
  // ============================================
  def validateSolution(actual: Int , expected: Int): Boolean = {
      actual.toString == expected.toString
  }
  
  def driver(str1: String, expected: Int): String = {
      try {
          if (validateSolution(PLACEHOLDER_FN_NAME(str1),expected)) {
              "PASSED"
          } else{
              "FAILED"
          }
      }catch{
          case e: Exception => {e.getClass.getName}
      }
  
  }
  object QuestionEvaluator extends App {
  
      println(s"TEST-0...${driver(
        "smnKL", 
        2    
      )}")   
  
  
      println(s"TEST-1...${driver(
        "270083", 
        3    
      )}")   
  
  
      println(s"TEST-2...${driver(
        "0", 
        0    
      )}")   
  
  
      println(s"TEST-3...${driver(
        "kcZdsz", 
        0    
      )}")   
  
  
      println(s"TEST-4...${driver(
        "483544224", 
        7    
      )}")   
  
  
      println(s"TEST-5...${driver(
        "000011", 
        1    
      )}")   
  
  
      println(s"TEST-6...${driver(
        "WysGCirMwKBzP", 
        3    
      )}")   
  
  
      println(s"TEST-7...${driver(
        "3366", 
        1    
      )}")   
  
  
      println(s"TEST-8...${driver(
        "110", 
        1    
      )}")   
  
  
      println(s"TEST-9...${driver(
        "NlaMkpCjUgg", 
        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;
  }