Skip to content

Commit 8a12635

Browse files
authored
feat: add ts solution to lc problem: No.2103 (#1916)
1 parent 5af91fa commit 8a12635

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

solution/2100-2199/2103.Rings and Rods/README.md

+10
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,16 @@ function countPoints(rings: string): number {
181181
}
182182
```
183183

184+
```ts
185+
function countPoints(rings: string): number {
186+
let c = 0;
187+
for (let i = 0; i <= 9; i++) {
188+
if (rings.includes('B' + i) && rings.includes('R' + i) && rings.includes('G' + i)) c++;
189+
}
190+
return c;
191+
}
192+
```
193+
184194
### **Rust**
185195

186196
```rust

solution/2100-2199/2103.Rings and Rods/README_EN.md

+10
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,16 @@ function countPoints(rings: string): number {
171171
}
172172
```
173173

174+
```ts
175+
function countPoints(rings: string): number {
176+
let c = 0;
177+
for (let i = 0; i <= 9; i++) {
178+
if (rings.includes('B' + i) && rings.includes('R' + i) && rings.includes('G' + i)) c++;
179+
}
180+
return c;
181+
}
182+
```
183+
174184
### **Rust**
175185

176186
```rust

0 commit comments

Comments
 (0)