2335. Minimum Amount of Time to Fill Cups

PHOTO EMBED

Wed Mar 22 2023 06:42:39 GMT+0000 (Coordinated Universal Time)

Saved by @Ranjan_kumar #c++

class Solution {
public:
    int fillCups(vector<int>& amount) {
        sort(amount.begin(), amount.end());
        int loww=amount[0], low=amount[1], lar=amount[2];
        int sum=low+loww+lar;
        if(lar<loww+low) return sum/2+sum%2;
        else return lar;
    }
};
content_copyCOPY

https://leetcode.com/contest/weekly-contest-301/problems/minimum-amount-of-time-to-fill-cups/