title: Count Characters String Distance English Alphabets
signature: countCharactersStringDistanceEnglishAlphabets :: String -> Integer
  countCharactersStringDistanceEnglishAlphabets str1 = 
test_code: import Text.Printf
  import Control.Exception (catch, SomeException)
  import Data.Typeable
  import qualified Data.List as List
  import qualified Data.Map as Map
  import qualified Data.Set as Set
  
  -- SOLUTION CODE
  -- ============================================
  
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  validateSolution :: Integer -> Integer -> Bool
  validateSolution actual expected = do
      actual == expected
  
  
  driver :: String -> Integer -> String
  driver str1 expected = do
      if (validateSolution (PLACEHOLDER_FN_NAME str1) expected)
          then "PASSED"
      else "FAILED"
  
  main = do
      printf "TEST-0...%s\n" (driver ("smnKL") (2) )
  
      printf "TEST-1...%s\n" (driver ("270083") (3) )
  
      printf "TEST-2...%s\n" (driver ("0") (0) )
  
      printf "TEST-3...%s\n" (driver ("kcZdsz") (0) )
  
      printf "TEST-4...%s\n" (driver ("483544224") (7) )
  
      printf "TEST-5...%s\n" (driver ("000011") (1) )
  
      printf "TEST-6...%s\n" (driver ("WysGCirMwKBzP") (3) )
  
      printf "TEST-7...%s\n" (driver ("3366") (1) )
  
      printf "TEST-8...%s\n" (driver ("110") (1) )
  
      printf "TEST-9...%s\n" (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;
  }