Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Dinner Dishes You are planning a dinner menu for an event, and you have a list of N dishes stored in array A vach with
Dinner Dishes
You are planning a dinner menu for an event, and you have a list of N dishes stored in array A vach with a certain cost associated with it You must select two such dishes, such that the sum of their costs is maximum among all available pairs Your task is to find and return an integer value representing the sum of such available pair. Return in case of no such pair available.
Input Specification:
input: An integer array A representing the cost of dishes
input: An integer value N representing the number of dishes available.
Output Specification:
Return an integer value representing sum of such pair available. In case, there are no such pair present, return
Example :
input:
input:
Output:
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