File tree 2 files changed +20
-0
lines changed
solution/2100-2199/2103.Rings and Rods
2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -181,6 +181,16 @@ function countPoints(rings: string): number {
181
181
}
182
182
```
183
183
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
+
184
194
### ** Rust**
185
195
186
196
``` rust
Original file line number Diff line number Diff line change @@ -171,6 +171,16 @@ function countPoints(rings: string): number {
171
171
}
172
172
```
173
173
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
+
174
184
### ** Rust**
175
185
176
186
``` rust
You can’t perform that action at this time.
0 commit comments