Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2 You are given an integer N . A string consisting of the lowercase English alphabet is called valld ifand only if each vowel occurs
You are given an integer A string consisting of the lowercase English alphabet is called valld ifand only if each vowel occurs at most once in the string.
Each vowel is assigned a score which is given by a score array of size where,
score refers to the score of a
score refers to the score of
score refers to the score of
score refers to the score of
score refers to the score of
The FUN of a string is defined as the sum of the product of the score of two consecutive vowels and their distance.
Your task is to find the sum of FUN of all possible valid strings of length and return the ans modulo
Input Format
The first line contains denoting the number of test cases. also Specifies the number of times you have to run the countThemAI function on a different set of inputs.
For each test case:
The first line contains denoting the length of the string.
The second line contains spaceseparated values denoting the scores of the vowels.
Output Format
For each test case, print the total FUN modulo in a new line.
imple Testcase #
estcase Input
Copy
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started