1276. Number of Burgers with No Waste of Ingredients

PHOTO EMBED

Thu Feb 23 2023 18:42:53 GMT+0000 (Coordinated Universal Time)

Saved by @Ranjan_kumar #c++

class Solution {
public:
    vector<int> numOfBurgers(int ts, int cs) {
        vector<int> a;
        if(ts%2==1||ts>4*cs||ts<2*cs) 
        {
            return a;
        }
        int p=ts/2;
        int tu=p-cs;
        int du=cs-tu;
        a.push_back(tu);
        a.push_back(du);
        return a;
    }
};
content_copyCOPY

https://leetcode.com/problems/number-of-burgers-with-no-waste-of-ingredients/