When multiple tasks are executed on a single-threaded CPU, the tasks are scheduled based on the principle of pre-emption. When a higher-priority task arrives in the execution queue, then the lower-priority task is pre-empted, i.e. its execution is paused until the higher-priority task is complete. There are n functions to be executed with each function on a single-having a unique ID between 0 and n - 1. Given an integer n, representing the number of functions to be executed, and an execution log as an array of strings, logs, of size m, determine the exclusive times of each of the functions. Exclusive time is the sum of execution times for all calls to a
function. Any string representing an execution log is of the form {function_id}{"start" "end"):(timestamp), indicating that the function with ID function_id, either starts or ends at a time identified by the timestamp value. 4 = Note: While calculating the execution time of a function call, both the starting and ending times of the function call have to be included. The log of the form
Not the question you are looking for? Ask here!
Enter question by text
Enter question by image
Upgrade to Asksia Pro
Join a AskSia's Pro Plan, and get 24/7 AI tutoring for your reviews, assignments, quizzes and exam preps.