Skip to content

Commit

Permalink
Merge pull request #91 from AlgoLeadMe/27-InSange
Browse files Browse the repository at this point in the history
27-InSange
  • Loading branch information
InSange authored Sep 2, 2024
2 parents f0978ec + 8026614 commit 6367547
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions InSange/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
| 24์ฐจ์‹œ | 2024.08.04 | BFS | [ํŠธ๋ฆฌ](https://www.acmicpc.net/problem/1068) | [#24](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/83)]
| 25์ฐจ์‹œ | 2024.08.10 | BFS | [Minimum Height Trees](https://leetcode.com/problems/minimum-height-trees/) | [#25](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/87)]
| 26์ฐจ์‹œ | 2024.08.11 | ์ˆ˜ํ•™ | [Magic Squares In Grid](https://leetcode.com/problems/magic-squares-in-grid/) | [#26](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/89)]
| 27์ฐจ์‹œ | 2024.08.17 | ๋ฌธ์ž์—ด | [Number of Senior Citizens](https://leetcode.com/problems/number-of-senior-citizens/) | [#27](https://github.com/AlgoLeadMe/AlgoLeadMe-8/pull/91)]
---

https://leetcode.com/problems/robot-collisions/
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include <iostream>
#include <vector>

using namespace std;

class Solution {
public:
int countSeniors(vector<string>& details) {
int seniorCount = 0;

for (string& passengerInfo : details) {
int ageTens = passengerInfo[11] - '0';
int ageOnes = passengerInfo[12] - '0';

int age = ageTens * 10 + ageOnes;

if (age > 60) {
seniorCount++;
}
}

return seniorCount;
}
};

0 comments on commit 6367547

Please sign in to comment.