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.
1) Write a Function to find the maximum of two integers
2) Write a Function to find the maximum profit
3)Let an array of size n+1 to store different profit possible
4)Initialize the first element of let array be 0
5)Find the max profit possible by checking all the possible cases
6)Store all the profit in ascending order in array
7)return the last element of array
Screenshots(Attach 2 screenshots of your own input and output) -
Attach here
Test cases-
Test caes1- if the length of the rod is 8 and the values of different pieces {1 5 8 9 10 17 17 20} then the maximum obtainable value is 22.
by cutting in two pieces of lengths 2 and 6
Test caes2- if the length of the rod is 5 and the values of different pieces {5 8 7 9 6} then the maximum obtainable value is 25.
by cutting in 5 pieces of lengths 1 each
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 -
[x] I have mentioned the question as comment in my solution file.
[x] My code follows the guidelines of this project.
[x] I have performed a self-review of my own code.
[x] I have commented my code.
[x] My code gives the correct output.
[x] I confirm that I have not copied the code from anywhere. In case its found that I have copied even after successful merge then I can be banned from the repository and hacktoberfest.
[x] I affirm that I strictly follow contributing guidelines and code of conduct.
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 -
[] I have performed a self-review of my documentation.
[] I affirm that I strictly follow contributing guidelines and code of conduct.
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 -
399
Briefly explain your program logic -
1) Write a Function to find the maximum of two integers 2) Write a Function to find the maximum profit 3)Let an array of size n+1 to store different profit possible 4)Initialize the first element of let array be 0 5)Find the max profit possible by checking all the possible cases 6)Store all the profit in ascending order in array 7)return the last element of array
Screenshots(Attach 2 screenshots of your own input and output) -
Attach here
Test cases-
Test caes1- if the length of the rod is 8 and the values of different pieces {1 5 8 9 10 17 17 20} then the maximum obtainable value is 22. by cutting in two pieces of lengths 2 and 6 Test caes2- if the length of the rod is 5 and the values of different pieces {5 8 7 9 6} then the maximum obtainable value is 25. by cutting in 5 pieces of lengths 1 each
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 -
[x] I have mentioned the question as comment in my solution file.
[x] My code follows the guidelines of this project.
[x] I have performed a self-review of my own code.
[x] I have commented my code.
[x] My code gives the correct output.
[x] I confirm that I have not copied the code from anywhere. In case its found that I have copied even after successful merge then I can be banned from the repository and hacktoberfest.
[x] I affirm that I strictly follow contributing guidelines and code of conduct.
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 -
[] I have performed a self-review of my documentation.
[] I affirm that I strictly follow contributing guidelines and code of conduct.