title: Count Characters String Distance English Alphabets
signature: countCharactersStringDistanceEnglishAlphabets(str1) {
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(str1, int expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(str1), expected)){
              return "PASSED";
          }
          return "FAILED";
      }catch(exception_object){
          return exception_object.runtimeType.toString();
      }
  }
  
  int main() {
  
      print("TEST-0...${driver(
          "smnKL", 
          2)
      }");
  
      print("TEST-1...${driver(
          "270083", 
          3)
      }");
  
      print("TEST-2...${driver(
          "0", 
          0)
      }");
  
      print("TEST-3...${driver(
          "kcZdsz", 
          0)
      }");
  
      print("TEST-4...${driver(
          "483544224", 
          7)
      }");
  
      print("TEST-5...${driver(
          "000011", 
          1)
      }");
  
      print("TEST-6...${driver(
          "WysGCirMwKBzP", 
          3)
      }");
  
      print("TEST-7...${driver(
          "3366", 
          1)
      }");
  
      print("TEST-8...${driver(
          "110", 
          1)
      }");
  
      print("TEST-9...${driver(
          "NlaMkpCjUgg", 
          2)
      }");
  
      return 0;
  }
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;
  }