From f76ad5de74e3c694acec962eddc7ada9b5c76143 Mon Sep 17 00:00:00 2001 From: jagdish-15 Date: Tue, 19 Nov 2024 21:38:08 +0530 Subject: [PATCH] Update exercises/practice/change/.approaches/dynamic-programming/content.md Co-authored-by: Kah Goh --- .../practice/change/.approaches/dynamic-programming/content.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/practice/change/.approaches/dynamic-programming/content.md b/exercises/practice/change/.approaches/dynamic-programming/content.md index 4c2ce7c1d..29ff4ee8a 100644 --- a/exercises/practice/change/.approaches/dynamic-programming/content.md +++ b/exercises/practice/change/.approaches/dynamic-programming/content.md @@ -61,6 +61,6 @@ It minimizes the number of coins needed by breaking down the problem into smalle - After processing all values up to `grandTotal`, the combination at `coinsUsed[grandTotal]` will represent the most efficient solution. - If no valid combination exists for `grandTotal`, an exception is thrown. -- **Time Complexity**: The time complexity of this approach is **O(n * m)**, where `n` is the `grandTotal` and `m` is the number of available coin denominations. This is because we iterate over all coin denominations for each amount up to `grandTotal`. +The time complexity of this approach is **O(n * m)**, where `n` is the `grandTotal` and `m` is the number of available coin denominations. This is because we iterate over all coin denominations for each amount up to `grandTotal`. - **Space Complexity**: The space complexity is **O(n)** due to the list `coinsUsed`, which stores the most efficient coin combination for each total up to `grandTotal`.