leetcode

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

commita3761c031bba3168a0c1379494890d375f8ab7f3
parent3ec73fcc24e0cbc771909f3c43f15e9be8150531
authorDimitrije Dobrota <mail@dimitrijedobrota.com>
dateSun, 9 Jun 2024 16:47:16 +0200

1 Random Problem

Diffstat:
AProblems/1276.cpp|++++++++++
MREADME.md|+

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) |