Question: def main(): def countPoints(rings: str) -> int: counter=0 for rod in range(0,1): list=[] for index, digit in enumerate(rings): if(digit == rod): list.append(rings[index-1]) if (R) in
def main():
def countPoints(rings: str) -> int:
counter=0
for rod in range(0,1):
list=[]
for index, digit in enumerate(rings):
if(digit == rod):
list.append(rings[index-1])
if ("R") in list and ("G") in list and ("B") in list:
counter+=1
return counter
print(countPoints("B0B6G0R6R0R6G9"))
if __name__ == "__main__":
main()
QUESTION: Why does the statement if(digit==rod) return false even when digit is 0?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
