public static ArrayList<Integer> quickSort(ArrayList<Integer> coins, int low, int high) {
        int i = low, j = high;
        int pivot = coins.get(low+(high-low)/2);
        while (i <= j){
            while(coins.get(i) < pivot){
                i++;
            }
            while(coins.get(j) > pivot) {
                j--;
            }
            if(i <= j){
                int swap = coins.get(i);
                coins.set(i,coins.get(j));
                coins.set(j,swap);
                i++;
                j--;
            }
        }
        if(low < j)
            quickSort(coins,low,j);
        if(i < high)
            quickSort(coins,i, high);
        return coins;
    }