From 023f3fe6e7ab4231e6b608e184ed5407c64edafd Mon Sep 17 00:00:00 2001 From: thinkasany <480968828@qq.com> Date: Mon, 23 Oct 2023 10:26:29 +0800 Subject: [PATCH] feat: add ts solution to lc problem: No.2678 --- solution/2600-2699/2678.Number of Senior Citizens/README.md | 6 ++++++ .../2600-2699/2678.Number of Senior Citizens/README_EN.md | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/solution/2600-2699/2678.Number of Senior Citizens/README.md b/solution/2600-2699/2678.Number of Senior Citizens/README.md index ce2a6c0d36c5d..ef392e98da8a7 100644 --- a/solution/2600-2699/2678.Number of Senior Citizens/README.md +++ b/solution/2600-2699/2678.Number of Senior Citizens/README.md @@ -167,6 +167,12 @@ function countSeniors(details: string[]): number { } ``` +```ts +function countSeniors(details: string[]): number { + return details.filter(v => parseInt(v.slice(11, 13)) > 60).length; +} +``` + ### **...** ``` diff --git a/solution/2600-2699/2678.Number of Senior Citizens/README_EN.md b/solution/2600-2699/2678.Number of Senior Citizens/README_EN.md index e09986b5bf6be..746b816736cce 100644 --- a/solution/2600-2699/2678.Number of Senior Citizens/README_EN.md +++ b/solution/2600-2699/2678.Number of Senior Citizens/README_EN.md @@ -157,6 +157,12 @@ function countSeniors(details: string[]): number { } ``` +```ts +function countSeniors(details: string[]): number { + return details.filter(v => parseInt(v.slice(11, 13)) > 60).length; +} +``` + ### **...** ```