public static List<String> findMissingRanges2(int[] A, int lower, int upper) {
        List<String> result = new ArrayList<String>();
        int len = A.length;

        int prev = lower - 1;
        for(int i = 0; i <= len; i++){
            int curr = (i == len) ? upper + 1 : A[i];
            if (curr - prev >= 2) {
                result.add(getRange(prev + 1, curr - 1));
            }
            prev = curr;
        }
        return result;
    }