what is wrong in this driver license code coach problem? | SoloLearn: Learn to code for FREE!

+3

# what is wrong in this driver license code coach problem?

3 and 5 case are printing errors 1,2,4 cases are working. can anyone tell me why? https://code.sololearn.com/cq0qcDb6D7R1/?ref=app

8/8/2020 12:25:44 PM

Mr. 12

0

Thank You All, My Code Is Working Fine. I have solved The Bug.

+6

Mr. 12 No, it's not like that. Each agent serves one person at a time, so A and C are served "simultaneously". So, 20 min. Then, if there are 3 agents, then it would take only 20 min, as E would be served in first round!

+5

Mr. 12 isn't round = (place // agents) + 1

+4

Mr. 12 the situation is that, the persons are served alphabetically. Each agent serve one person at a time. And, one round takes 20 min. In the example, A and C are served in first round which takes 20 min, and then E (you) and F gets served. This takes another 20 min. Finally, you have license, after 40 min!

+3

Time to process a licence is always 20 minutes, regardless of the number of agents. Remember, the licence is being given to you by the agent that is serving & the process takes 20 minutes. If there were more agents than customers, then the other agents would be drinking tea

+3

Mr. 12 We can't provide you with a complete Code Coach solution as Sololearn has presented these as personal challenges. We can only try to guide you. The difficulties you encounter while trying to solve the problems help re-inforce the learning process

+2

20 mins not 10 mins

+2

you can divide with the agents to find out the lowest time but note that 20 minute is atleast.

+2

Rik Wittkopp i am not asking your code and i dont want anyone code. i am saying, i think i didn't understand the problem well, Just explain Me The Problem. ** I am Not Asking Code ** i didn't understand about agents in the problem

+2

Mr. 12 ,see @RahulVerma comments.

+2

sum =0; for i in range (0,place,agents): sum += 20 print(sum)

+2

+1

Mr. 12 Your rounding function could either round Up or round DOWN depending on the fraction generated by your previous line of code. Inspect that element and adjust your code to suit.

+1

You might wish to investigate the ceil function. import math math.ceil(func)

+1

Rik Wittkopp can we do without importing math? , because i haven't learned all about math

+1

Mr. 12 ,note that it will take time at least 20 minutes to give new driver licence .Now figure yourself what's wrong.

+1

Mr. 12 You don't need to learn all about something to use it. Google the bits you need and then implement it, that way you will learn bit by bit.

+1

yes Rik Wittkopp , if it is our turn to get license, it will add 20 mins and calculate the time with no. of agents. but if we come first order, we got 2 agents, then time will be 10mins or 20mins ?

+1

so, we dont have to divide with the agent?

+1

Samsil Arefeen Rik Wittkopp this? import math you = input() agents = input() fourpersons = input().split() fourpersons.append(you) count = 0 print(fourpersons) for person in sorted(fourpersons): if person == you and count ==0 : count += 20 print(count) quit() elif person == you and count > 20: count += 20 count /= int(agents) print(math.ceil(count)) quit() else : count += 20 https://code.sololearn.com/cu5YGkH34une/?ref=app