You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, our crate uses a greedy algorithm for calculating the optimal change for various currencies. While this approach works well for many currencies, it might not provide the optimal solution for custom currencies with specific denominations.
We want to implement the dynamic programming approach as an alternative to the greedy algorithm. This will ensure that we can provide the most accurate change calculation for custom currencies and any other currencies where the greedy approach fails to give the optimal solution.
To accomplish this task, we need to:
Implement the dynamic programming algorithm for change calculation.
Update the CurrencyKind enum to include a method for specifying the recommended algorithm (greedy or dynamic) for each currency.
Update the change calculation function to use the recommended algorithm based on the input currency.
Add tests to verify the correctness of the dynamic programming approach.
Update the README to explain the two algorithms and how the crate chooses the best one for each currency.
By implementing the dynamic programming approach, we can improve the versatility and accuracy of our crate, making it more appealing to potential users and contributors.
The text was updated successfully, but these errors were encountered:
Currently, our crate uses a greedy algorithm for calculating the optimal change for various currencies. While this approach works well for many currencies, it might not provide the optimal solution for custom currencies with specific denominations.
We want to implement the dynamic programming approach as an alternative to the greedy algorithm. This will ensure that we can provide the most accurate change calculation for custom currencies and any other currencies where the greedy approach fails to give the optimal solution.
To accomplish this task, we need to:
By implementing the dynamic programming approach, we can improve the versatility and accuracy of our crate, making it more appealing to potential users and contributors.
The text was updated successfully, but these errors were encountered: