P18917 [GeeksforGeeks] Difficulty of sentence5856
普及-
题目描述

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
Your task:
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

输入格式

见题面

输出格式

见题面

样例输入
S = "Difficulty of sentence"
样例输出
13