From 218b6be7a50b8c089b694d8fe6c25c170a40f6cf Mon Sep 17 00:00:00 2001 From: sumanth <58482399+sumanth00100@users.noreply.github.com> Date: Sat, 18 Apr 2026 20:27:52 -0400 Subject: [PATCH] HashSet --Design 1 --- problem1.java | 30 ++++++++++++++++++++++++++++++ problem2.java | 20 ++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 problem1.java create mode 100644 problem2.java diff --git a/problem1.java b/problem1.java new file mode 100644 index 00000000..e0620f0a --- /dev/null +++ b/problem1.java @@ -0,0 +1,30 @@ +// Time Complexity : O(m*n) +// Space Complexity : O(m*n) +// Did this code successfully run on Leetcode : Yes +// Any problem you faced while coding this : No + + + +class Solution { + public int coinChange(int[] coins, int amount) { + int m = coins.length; + int n = amount; + int[][] dp = new int[m+1][n+1]; + dp[0][0] = 0; + for(int i=1;i<=n;i++){ + dp[0][i] = 999999; + } + for(int i=1;i<=m;i++){ + for(int j=0;j<=n;j++){ + if(j