Message on Whatsapp 8879355057 for DSA(OA + Interview) + Fullstack Dev Training + 1-1 Personalized Mentoring to get 10+LPA Job
0 like 0 dislike
1,613 views
in Online Assessments by Expert (46,090 points) | 1,613 views

2 Answers

0 like 0 dislike
Best answer

imageimageimageimage

Images of ques

by Expert (46,090 points)
0 like 0 dislike
long getMaxAggregateTemperatureChange(vector<int> tempChange){
long total=0,sumTillNow=0;
long maxi=INT_MIN;
for(int i=0;i< tempChange.size(); i++){
total+=tempChange[i];
}
for(int i=0;i<tempChange.size();i++){
    sumTillNow+=tempChange[i];
    maxi=max(max(sumTillNow,total-sumTillNow+tempChange[i]),maxi);
    }
    return maxi;
}
by Expert (46,090 points)