commit 6abcda5cb34c4f596139976b0cef0fd55d71144f
parent acfbb6a468b3c838a76fad1de168a18c8558b582
Author: Dimitrije Dobrota <mail@dimitrijedobrota.com>
Date: Thu, 1 Aug 2024 23:24:58 +0200
Daily Problem
Diffstat:
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) |