A single-threaded CPU runs functions logged as 'id:start:time' or 'id:end:time'. Given n functions and the logs in order, return the exclusive time of each function — the total time spent in it, excluding time spent in nested calls. The input is JSON {n, logs}.
Input: JSON {n, logs}.
Output: Array — the exclusive time per function id.
Input: {"n":2,"logs":["0:start:0","1:start:2","1:end:5","0:end:6"]}
Output: [3,4]
Explanation: Function 1 runs 4 units; function 0 runs 3 excluding the nested call.Input: {"n":1,"logs":["0:start:0","0:end:0"]}
Output: [1]
Explanation: One unit of time.Input: {"n":1,"logs":["0:start:0","0:end:4"]}
Output: [5]
Explanation: Five inclusive units.1<=n<=1002<=logs<=500