2103. Rings and Rods
Содержание
class Solution:
def countPoints(self, rings: str) -> int:
mask = [0] * 10
d = {"R": 1, "G": 2, "B": 4}
for i in range(0, len(rings), 2):
c = rings[i]
j = int(rings[i + 1])
mask[j] |= d[c]
return mask.count(7)