nzt
BAN USER- 3of 3 votes
AnswersGiven a list of input tasks to run, and the cooldown interval, output the minimum number of time slots required to run them.
- nzt in United States
// Tasks: 1, 1, 2, 1, 2
// Recovery interval (cooldown): 2
// Output: 8 (order is 1 _ _ 1 2 _ 1 2 )
=========
Tasks are task numbers in that order coming in for execution. Cooling time is time interval required to cool down the machine after executing a task. So it's like if CPU executed task 1 then it needs 2 cooling time intervals before executing another task 1 but meanwhile, it can execute other tasks which are not same as 1 and so on. So before executing any task, you have to check if you have executed same task number before and if yes, then if its cooling time interval is done or not.
The output is basically the number of cycles/time slots CPU took to execute these tasks in that order (including when task executed and cooling intervals).| Report Duplicate | Flag | PURGE
Facebook Software Engineer
Repmalloymirna65, Developer Advocate at 247quickbookshelp
I am Mirna Timekeeping clerks distribute and collect timesheets, timecards or work charts either as hard copies or electronically to ...
RepGeraldRuder, Kindergarten teacher at Nelson Brothers
I am a kindergarten teacher who teaches basic written and reading skills to children. I make learning fun with numerous ...
RepCallaRita, techsupport at Knowledge Systems
Hi, I am an Administrative person . It is to develop and sustain an early childhood organisation. I was a teacher ...
Repamberdjohnson859, Backend Developer at ABC TECH SUPPORT
We are Responsible Environmental Technicians utilizing all of the resources available to develop practical solutions to corporate issues. Currently doing ...
Repolliejshea, Android test engineer at ABC TECH SUPPORT
Hello I am an application engineer. I love my work very much. Nowadays I am doing some new experiments. Like ...
Repchrishwalsh369@gmail.com, Android Engineer at ABC TECH SUPPORT
A computer operator is a role in IT that oversees the running of a computer system.Apart from this, today ...
RepEdwin Adcox, Dev Lead at Advisory Board Company
Welcome to the best and certified exotic car rental company of USA. Here, at Prestige luxury Rentals, we offer the ...
Repnormadyen, Blockchain Developer at 247quickbookshelp
I am working as a Pharmacy technician in Sunny Sypus company. I can maintain employee records for a company or ...
Repjuanitasfalbo45, Android Engineer at 247quickbookshelp
Hey, Juanita Falbo, and I am working as a Yoga instructor. And nowadays I am doing a new experiment on ...
RepOwenKary, Analyst at ASU
I am an experienced software engineer with a passion for java developing innovative programs that expedite the efficiency and effectiveness ...
RepZairaMoore, Accountant at AMD
I am an ambitious and promising young chef with culinary education and prestigious intern and entry-level work experience. I trained ...
RepPennyStringer, Music director at Poore Simon's
I am a Music director and writer and live in Newark USA . I spend most of my time writing essays ...
RepEddieCody, abc at A9
I am a creative freelance graphic designer with over 3 years of experience in developing engaging and innovative digital and ...
RepAadenGarcia, Analyst at ADP
I have a knowledgeable professional librarian with more than 4 years of experience in the public library setting. I have ...