public CoinChange(int totalAmount, Integer denomination[])
	{
		this.totalAmount = totalAmount;
		coin = new int[totalAmount + 1];
		this.n = new int[totalAmount + 1];

		// Base case
		n[0] = 0;
		for (int i = 1; i <= totalAmount; i++)
			n[i] = Integer.MAX_VALUE;

		// Optimal substructure
		for (int amount = 1; amount <= totalAmount; amount++)
			for (int i = 0; i < denomination.length; i++)
				if (amount - denomination[i] >= 0)
					if (n[amount] > n[amount - denomination[i]] + 1)
					{
						n[amount] = n[amount - denomination[i]] + 1;
						coin[amount] = denomination[i];
					}
	}