private void printCoinCombination(int R[], int coins[]) {
        if (R[R.length - 1] == -1) {
            System.out.print("No solution is possible");
            return;
        }
        int start = R.length - 1;
        System.out.print("Coins used to form total ");
        while ( start != 0 ) {
            int j = R[start];
            System.out.print(coins[j] + " ");
            start = start - coins[j];
        }
        System.out.print("\n");
    }
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