• + 0 comments
    int diff = abs(b-a);
        int ans = (n-1)*min(a,b);
        
        vector<int>result;
        result.push_back(ans);
        
        for(int i = 0; i< n-1;i++){
            if(result[i]+diff == result[i]) continue;
            result.push_back(result[i]+diff);  
        } 
        
        return  result;