title: Count Characters String Distance English Alphabets
signature: fun countCharactersStringDistanceEnglishAlphabets(str1: String): Int {
test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:Int, expected:Int):Boolean{
    return actual.equals(expected)
  }
  fun driver(str1: String, expected:Int):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(str1), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver("smnKL", 2)
      println("TEST-0...${result}")
      
      result = driver("270083", 3)
      println("TEST-1...${result}")
      
      result = driver("0", 0)
      println("TEST-2...${result}")
      
      result = driver("kcZdsz", 0)
      println("TEST-3...${result}")
      
      result = driver("483544224", 7)
      println("TEST-4...${result}")
      
      result = driver("000011", 1)
      println("TEST-5...${result}")
      
      result = driver("WysGCirMwKBzP", 3)
      println("TEST-6...${result}")
      
      result = driver("3366", 1)
      println("TEST-7...${result}")
      
      result = driver("110", 1)
      println("TEST-8...${result}")
      
      result = driver("NlaMkpCjUgg", 2)
      println("TEST-9...${result}")
      
          
  }
  
  main()
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;
  }