Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data Concepts, Theories, And Applications

Authors: Shui Yu, Song Guo

1st Edition

3319277634, 9783319277639

More Books

Students also viewed these Databases questions

Question

=+46. Monthly gas prices, part 3. Using the data from Exercise

Answered: 1 week ago

Question

1 0 6 8 . .

Answered: 1 week ago

Question

What factors in Nooyis Five C model facilitate employee trust?

Answered: 1 week ago