public static int getLeastWays(int[] denoms, int sum){
		//count the least number of coins for a sum
		
		int[] table = new int[sum+1];
		for(int i = 0;i<table.length;i++){
			table[i] = Integer.MAX_VALUE;
		}
		
		table[0] = 0;
		for(int i=0;i<denoms.length;i++){
			for(int j = denoms[i];j<=sum;j++){
				table[j] = Math.min(table[j-denoms[i]]+1,table[j]);
			}
		}
		
		return table[sum];
	}