Given a lowercase string that has alphabetic characters only and no spaces, return the highest value of consonant substrings. Consonants are any letters of the alphabet except `"aeiou"`. 

We shall assign the following values: `a = 1, b = 2, c = 3, .... z = 26`.

For example, for the word "zodiacs", let's cross out the vowels. We get: "z **~~o~~** d **~~ia~~** cs"

For C: do not mutate input.

More examples in test cases. Good luck!

If you like this Kata, please try:

[Word values](https://www.codewars.com/kata/598d91785d4ce3ec4f000018)

[Vowel-consonant lexicon](https://www.codewars.com/kata/59cf8bed1a68b75ffb000026)

Source: codewars | Difficulty: EASY
Tags: String algorithms

Fundamentals

Starter code: def solve(s):
	

Solutions:
import re

def solve(s):
	return max((sum((ord(c) - 96 for c in subs)) for subs in re.split('[aeiou]+', s)))


def solve(s):
	max_ord = 0
	curr_ord = 0
	for char in s:
		if char not in 'aeiou':
			curr_ord += ord(char) - ord('a') + 1
		else:
			if curr_ord > max_ord:
				max_ord = curr_ord
			curr_ord = 0
	return max_ord


def solve(s):
	count = 0
	max = 0
	vowels = ['a', 'e', 'i', 'o', 'u']
	for letter in s:
		if letter in vowels:
			if count > max:
				max = count
			count = 0
		else:
			count += int(ord(letter)) - 96
	return max


import string

def solve(s):
	string_list = list(s)
	alphabets = list(string.ascii_lowercase)
	test = []
	for i in range(1, len(alphabets) + 1):
		test.append(i)
	my_dictionary = dict(zip(alphabets, test))
	vowels = 'aeiou'
	vowels_list = list(vowels)
	compare_list1 = []
	for i in range(len(string_list)):
		if string_list[i] in my_dictionary and string_list[i] not in vowels:
			l = my_dictionary[string_list[i]]
			compare_list1.append(l)
		else:
			compare_list1.append('vowels')
	z = compare_list1
	x = []
	l = len(z)
	previous_element = 0
	count = 0
	if isinstance(z[0], int) == True:
		count = z[0]
	elif z[0] == 'vowels':
		previous_element = z[0]
	for i in range(1, l):
		if previous_element == 'vowels':
			if count > 0:
				x.append(count)
			count = 0
		elif isinstance(previous_element, int) == True:
			count = count + previous_element
		previous_element = z[i]
	if isinstance(z[l - 1], int) == True:
		count = count + previous_element
		x.append(count)
	elif z[l - 1] == 'vowels':
		x.append(count)
	print(x)
	y = max(x)
	return y
solve('zodiacs')


def solve(s):
	s = s.replace('a', ' ').replace('e', ' ').replace('i', ' ').replace('u', ' ').replace('o', ' ')
	return max((sum((ord(i) - 96 for i in j)) for j in s.split()))


import re
CONS_PAT = re.compile('[^aeiuo]+')

def solve(s):
	return max((sum(map(lambda c: ord(c) - 96, conss)) for conss in CONS_PAT.findall(s)))


import re
import string
scores = {c: i for (i, c) in enumerate(string.ascii_lowercase, 1)}

def solve(s):
	return max((sum(map(scores.get, x)) for x in re.findall('[^aeiou]+', s)))


def solve(s):
	max_so_far = 0
	max_ending_here = 0
	for char in s:
		if isConsonant(char):
			max_ending_here += getValue(char)
			max_so_far = max(max_so_far, max_ending_here)
		else:
			max_ending_here = 0
	return max_so_far

def isConsonant(char):
	return char not in 'aeiou'

def getValue(char):
	return ord(char) & -ord('a')


import re
from string import ascii_lowercase as c

def solve(s):
	return max([sum(map(lambda x: c.index(x) + 1, list(i))) for i in re.findall('[^aeiou]+', s)])