Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started