From ddb76145355cffafd45b3f6de11a6a6d016fcd94 Mon Sep 17 00:00:00 2001 From: Ravi Desai Date: Thu, 5 Jul 2018 10:57:20 +0530 Subject: [PATCH] Removing redundant if condition for loop above if condition is starting from coin and operation is increment in loop so value of i will be always >= coin hence if condition is redundant there --- Dynamic Programming/CoinChange.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/Dynamic Programming/CoinChange.java b/Dynamic Programming/CoinChange.java index 51fc64a5..f4cda720 100644 --- a/Dynamic Programming/CoinChange.java +++ b/Dynamic Programming/CoinChange.java @@ -29,9 +29,7 @@ public class CoinChange { for (int coin : coins) { for (int i=coin; i=coin) { combinations[i] += combinations[i-coin]; - } } // Uncomment the below line to see the state of combinations for each coin // printAmount(combinations);