leetcode

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

commit6abcda5cb34c4f596139976b0cef0fd55d71144f
parentacfbb6a468b3c838a76fad1de168a18c8558b582
authorDimitrije Dobrota <mail@dimitrijedobrota.com>
dateThu, 1 Aug 2024 21:24:58 +0200

Daily Problem

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

2 files changed, 13 insertions(+), 0 deletions(-)


diff --git a/Problems/2678.cpp b/Problems/2678.cpp

@@ -0,0 +1,12 @@

class Solution {
public:
int countSeniors(const vector<string> &details) const {
int res = 0;
for (const auto &detail : details) {
if (detail[11] < '6') continue;
if (detail[11] > '6' || detail[12] > '0') res++;
}
return res;
}
};

diff --git a/README.md b/README.md

@@ -1241,6 +1241,7 @@ for solving problems.

| 2672 | Medium | [Number of Adjacent Elements With the Same Color](Problems/2672.cpp) |
| 2673 | Medium | [Make Costs of Paths Equal in a Binary Tree](Problems/2673.cpp) |
| 2676 | Medium | [Throttle](Problems/2676.js) |
| 2678 | Easy | [Number of Senior Citizens](Problems/2678.cpp) |
| 2679 | Medium | [Sum in a Matrix](Problems/2679.cpp) |
| 2683 | Medium | [Neighboring Bitwise XOR](Problems/2683.cpp) |
| 2685 | Medium | [Count the Number of Complete Components](Problems/2685.cpp) |