SarthakKeshari / CPP-Questions-and-Solutions

This repository aims to solve and create new problems from different spheres of coding. A path to help students to get access to solutions and discuss their doubts.
MIT License
47 stars 132 forks source link

Maximum Sum Increasing Subsequence #455

Closed PrakharRathore123 closed 2 years ago

PrakharRathore123 commented 2 years ago

Choose your form and fill it -

1. Form 1(C++ Solution contributors)

FORM 1

2. Form 2(C++ Documentation Contributors)


1) Form 1

Issue Id you have worked upon -

401

Kindly write your answer here

Briefly explain your program logic -

1)Write the Function to find the maximum increasing sum 2)let an array of size n 3)Store given array in let array 4) If array is increasing and sum is increasing then Add the value in let array 5)find the max sum in array 6)Return the maximum sum

Screenshots(Attach 2 screenshots of your own input and output) -

Attach here MAX1 MAX2


Test cases-

Test case 1) For input {1, 101, 2, 3, 100, 4, 5}} output should be 106 because the max sum increasing sequence 1,2,3,100 Because we have find the Maximum Maximum Sum Increasing Subsequence and length of subsequence is 4, Test case 2) For input {3, 4, 5, 10} output should be 3+4+5+10=22 Max longest subsequence is 4.

Checklist:

Eg - If your code follow the below guidelines. Kindly change [] to [x]

All the conditions should be fulfilled for considering your code for merging -


2) Form 2

Issue Id you have worked upon -

Kindly write your answer here


Checklist:

Eg - If your code follow the below guidelines. Kindly change [] to [x]

All the conditions should be fulfilled for considering your Pull Request for merging -

PrakharRathore123 commented 2 years ago

@SarthakKeshari Kindly acknowledge this pull request