Maximum Consecutive Gap Time : Space : 12345678int Solution::maximumGap(const vector<int> &A) { vector<int> AA; for(auto& a : A) AA.push_back(a); sort(begin(AA), end(AA)); int res = 0; for(int i = 0; i < AA.size()-1; i++) res = max(res, AA[i+1] - AA[i]); return res;}