Question: Write a C + + function called grodArry that takes a reference to an integer array called ere and does the following: Prints Good if
Write a function called grodArry that takes a reference to an integer array called ere and does the following:
Prints "Good" if there is an element in the array, called "BigNumber," whose value equals the sum of all odd elements excluding itself
Prints "VeryGood" if you can swap the "BigNumber" with any other element to make the array a palindrome if the array is printed from left to right or printed from right to left the result is the same
Otherwise, prints NO
For example:
For the array arr the outpot is "Good" because arr ss equal to the sum of all odd elements
For the amray ar the output is "VeryGood" because anr is equal to the sum all odd elements. Additionally, swapping it with am makes the array a palinfrome
For the array arr the output is NO because there is an BigNumber
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
