public int coinChange2(int[] a, int n) {
        if(a==null || a.length==0)return -1;
        Arrays.sort(a);
        findMinRecursive(a, n, a.length - 1, 0);
        return count==Integer.MAX_VALUE ? -1 : count;
    }
This is brute force accepted solution with a lot of pruning.
In most cases, this almost exponential solution is not accepted
Idea is generating all possible permutations and pruning by avoiding some cases
src/problems/medium/CoinChange.java