public int minimumCoinBottomUp(int total, int coins[]){
        int T[] = new int[total + 1];
        int R[] = new int[total + 1];
        T[0] = 0;
        for(int i=1; i <= total; i++){
            T[i] = Integer.MAX_VALUE-1;
            R[i] = -1;
        }
        for(int j=0; j < coins.length; j++){
            for(int i=1; i <= total; i++){
                if(i >= coins[j]){
                    if (T[i - coins[j]] + 1 < T[i]) {
                        T[i] = 1 + T[i - coins[j]];
                        R[i] = j;
                    }
                }
            }
        }
        printCoinCombination(R, coins);
        return T[total];
    }
Bottom up way of solving this problem.
Keep input sorted. Otherwise temp[j-arr[i]) + 1 can become Integer.Max_value + 1 which
can be very low negative number
Returns Integer.MAX_VALUE - 1 if solution is not possible.
src/com/interview/dynamic/CoinChangingMinimumCoin.java