• + 0 comments
    // Add your code here
    Difference(vector<int> elems) : elements(elems) {}
        
    void computeDifference() {
        vector<int> elementsCopy = elements;
        sort(elementsCopy.begin(), elementsCopy.end());
            
        this->maximumDifference = elementsCopy[elementsCopy.size() - 1] - elementsCopy[0];
    }