private static void quickSort(String[] rocks, int low, int high){
        int i = low, j = high;
        int pivot = rocks[low+(high-low)/2].length();
        while (i <= j){
            while (rocks[i].length() < pivot) {
                i++;
            }
            while (rocks[j].length() > pivot) {
                j--;
            }
            if (i <= j) {
                String tmp = rocks[i];
                rocks[i] = rocks[j];
                rocks[j] = tmp;
                i++;
                j--;
            }
        }
        if (low < j)
            quickSort(rocks,low,j);
        if (i < high)
            quickSort(rocks,i,high);
    }