leetcode

Solution to some Leetcode problems written in C++
git clone git://git.dimitrijedobrota.com/leetcode.git
Log | Files | Refs | README | LICENSE

commit a3761c031bba3168a0c1379494890d375f8ab7f3
parent 3ec73fcc24e0cbc771909f3c43f15e9be8150531
Author: Dimitrije Dobrota <mail@dimitrijedobrota.com>
Date:   Sun,  9 Jun 2024 18:47:16 +0200

1 Random Problem

Diffstat:
AProblems/1276.cpp | 10++++++++++
MREADME.md | 1+
2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/Problems/1276.cpp b/Problems/1276.cpp @@ -0,0 +1,10 @@ +class Solution { + public: + vector<int> numOfBurgers(const int tomatoSlices, int const cheeseSlices) const { + if (tomatoSlices % 2) return {}; + if (cheeseSlices * 4 < tomatoSlices) return {}; + if (cheeseSlices * 2 > tomatoSlices) return {}; + + return {tomatoSlices / 2 - cheeseSlices, cheeseSlices * 2 - tomatoSlices / 2}; + } +}; diff --git a/README.md b/README.md @@ -720,6 +720,7 @@ for solving problems. | 1267 | Medium | [Count Servers that Communicate](Problems/1267.cpp) | | 1268 | Medium | [Search Suggestions System](Problems/1268.cpp) | | 1269 | Hard | [Number of Ways to Stay in the Same Place After Some Steps](Problems/1269.cpp) | +| 1276 | Medium | [Number of Burgers with No Waste of Ingredients](Problems/1276.cpp) | | 1277 | Medium | [Count Square Submatrices with All Ones](Problems/1277.cpp) | | 1280 | Easy | [Students and Examinations](Problems/1280.cpp) | | 1282 | Medium | [Group the People Given the Group Size They Belong To](Problems/1282.cpp) |