diff --git a/solution/2100-2199/2103.Rings and Rods/README.md b/solution/2100-2199/2103.Rings and Rods/README.md index f330da6375382..7ff5f669bdff4 100644 --- a/solution/2100-2199/2103.Rings and Rods/README.md +++ b/solution/2100-2199/2103.Rings and Rods/README.md @@ -181,6 +181,16 @@ function countPoints(rings: string): number { } ``` +```ts +function countPoints(rings: string): number { + let c = 0; + for (let i = 0; i <= 9; i++) { + if (rings.includes('B' + i) && rings.includes('R' + i) && rings.includes('G' + i)) c++; + } + return c; +} +``` + ### **Rust** ```rust diff --git a/solution/2100-2199/2103.Rings and Rods/README_EN.md b/solution/2100-2199/2103.Rings and Rods/README_EN.md index 7cd317c3a3970..556873e549c4c 100644 --- a/solution/2100-2199/2103.Rings and Rods/README_EN.md +++ b/solution/2100-2199/2103.Rings and Rods/README_EN.md @@ -171,6 +171,16 @@ function countPoints(rings: string): number { } ``` +```ts +function countPoints(rings: string): number { + let c = 0; + for (let i = 0; i <= 9; i++) { + if (rings.includes('B' + i) && rings.includes('R' + i) && rings.includes('G' + i)) c++; + } + return c; +} +``` + ### **Rust** ```rust