+ 2

Code coach drivers license

CAN ANY BODE HELP ME ON CODE COACH dRIVERS LICENSE? New Driver's License You have to get a new driver's license and you show up at the office at the same time as 4 other people. The office says that they will see everyone in alphabetical order and it takes 20 minutes for them to process each new license. All of the agents are available now, and they can each see one customer at a time. How long will it take for you to walk out of the office with your new license? Task Given everyone's name that showed up at the same time, determine how long it will take to get your new license. Input Format Your input will be a string of your name, then an integer of the number of available agents, and lastly a string of the other four names separated by spaces. Output Format You will output an integer of the number of minutes that it will take to get your license. Sample Input 'Eric' 2 'Adam Caroline Rebecca Frank' Sample Output 40

27th Jan 2020, 12:37 PM
G4M3S4L1F3
G4M3S4L1F3 - avatar
7 Answers
+ 7
What do you mean what problem your stuck on? what is your question?
27th Jan 2020, 12:39 PM
Easham Halder
Easham Halder - avatar
+ 3
For Python Language name = input() agents = int(input()) clients = input() clients = clients.split() clients.append(name) clients.sort(reverse=True) time = 0 reminder = True while reminder: for i in range(agents): if clients[-1] == name: reminder = False break clients.pop() time += 1 print(time * 20)
1st Feb 2022, 7:18 PM
Avrian Shandy
Avrian Shandy - avatar
4th Dec 2020, 5:21 AM
Tanmay Prakash Powar
Tanmay Prakash Powar - avatar
+ 1
hope it will help you
4th Dec 2020, 5:21 AM
Tanmay Prakash Powar
Tanmay Prakash Powar - avatar
+ 1
myname = input() num_agents = int(input()) other_names = list(input().split()) other_names.append(myname) other_names.sort() ind_myname = other_names.index(myname)+1 print('20' if ind_myname <=num_agents else (ind_myname-num_agents)*20+20)
25th Nov 2021, 10:32 PM
Mas'ud Saleh
Mas'ud Saleh - avatar
0
name = input() agents = int(input()) clients = input() clients = clients.split() clients.append(name) clients.sort(reverse=True) time = 0 reminder = True while reminder: for i in range(agents): if clients[-1] == name: reminder = False break clients.pop() time += 1 print(time * 20)
17th May 2020, 11:10 AM
Oliver Reyes
Oliver Reyes - avatar
0
#Swift #swift import Foundation var myname = readLine() ?? "" var agents = Int(readLine() ?? " ") ?? 0 var ppl = readLine() ?? "" var main = (ppl+" "+myname).split(separator: " ").sorted() var time = 0 for i in main{ if i != myname{ time+=1 }else{time+=1; break} } print(Int((Float(time)/Float(agents)).rounded(.up))*20)
11th Oct 2022, 3:05 PM
Artem Leschenko
Artem Leschenko - avatar