Showing:
Handle Score
@Ibrahim Nash 6564
@mb1973 5785
@Quandray 5275
@akhayrutdinov 5111
@saiujwal13083 5074
@kirtidee18 4639
@sanjay05 3762
@mantu_singh 3712
@gfgaccount 3627
@marius_valentin_dragoi 3525
Difficulty of sentence
Basic Accuracy: 43.87% Submissions: 260 Points: 1

Given a sentence as a string S. Calculate difficulty of a given sentence.

Difficulty of sentence is defined as 5*(number of hard words) + 3*(number of easy words). A word in the given string is considered hard if it has 4 consecutive consonants or number of consonants are more than number of vowels. Else the word is easy.
Note: uppercase and lowercase characters are same.

Example

Input:
S = "Difficulty of sentence"
Output:
13
Explanation:
2 hard words + 1 easy word

Example

Input:
S = "I am good"
Output:
9
Explanation:
3 easy words
You don't have to read input or print anything. Your task is to complete the functioin calcDiff() which takes the string S as input and returns the difficulty of the sentence.

Expected Time Complexity : O(len(s)
Expected Auxilliary Space : O(1)

Constraints:
1<= length( S ) <= 105