-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add burst balloons problem #2749
base: master
Are you sure you want to change the base?
Conversation
Dynamic programming does not compile at the moment I'll review this soon but trying to get the ci fixed hope you understand |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contributions
#include <iostream> | ||
#include <vector> | ||
#include <cassert> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These headers should be documented
#include <vector> | ||
#include <cassert> | ||
|
||
using namespace std; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using namespace std; |
int expected_result3 = 9; // Expected output | ||
int result3 = dynamic_programming::burst_balloons::maxCoins(nums3); | ||
assert(result3 == expected_result3); | ||
cout << "Test 3 passed: Maximum coins = " << result3 << endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add empty and negative test cases or use uint32_t as the parameter type
Description of Change
This PR implements the Burst Balloons problem using dynamic programming and memoization, encapsulated within the dynamic_programming::burst_balloons namespace. The algorithm maximizes coins obtained by strategically bursting balloons. Test cases based on the problem statement have been added to ensure correctness.
Checklist
Notes:
This implementation addresses an optimal solution for the Burst Balloons problem (example inputs provided in test cases). It uses memoization to avoid recalculating overlapping subproblems and follows proper documentation practices using Doxygen-style comments.
This submission is intended to enhance the library’s dynamic programming section.