mirror of
https://gitlab.com/mfocko/LeetCode.git
synced 2024-11-14 09:59:41 +01:00
16 lines
260 B
Java
16 lines
260 B
Java
|
class Solution {
|
||
|
public int countSeniors(String[] details) {
|
||
|
int count = 0;
|
||
|
|
||
|
for (String citizen : details) {
|
||
|
var age = Integer.parseInt(citizen.substring(11, 13));
|
||
|
|
||
|
if (age > 60) {
|
||
|
++count;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return count;
|
||
|
}
|
||
|
}
|