Question: Max Elements sum upto target Problem: Find the maximum elements in an given array that would sum upto a given target. Constraints: Maximum elements in
Max Elements sum upto
target
Problem:
Find the maximum elements in an given
array that would sum upto a given target.
Constraints:
Maximum elements in array is
Input:
First line specifies the number of
elements in the array plus the target.
Second line specified the target
Subsequent lines contain the elements
of array Integers
ets say arr so our goal is to get maximum number of elements that can sum upto a given target. Lets suppose target is Although we can take but it does not have max elements is answer
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
