Phone Interview. Hackerrank question.
void print(List <String> logs, int k)
Given the list of input log lines describing jobs that have started or ended and positive integer k.
Print out the name and time of K distinct jobs with the longest running job instances.
Input:
Started name=dump_logs jobid=f863
Started name=dump_logs jobid=g301gas
........
Ended jobid = f863 time=1021
Started name=grep_logs jobid=ac3de
Ended jobid = g301gas time=1343
Started name=read_logs jobid=r0eas
Started name=write_logs jobid=dg2dz
Started name=grep_logs jobid=v87ft
Started name=write_logs jobid=ttre8
Ended jobid = ac3de time=52
Ended jobid = v87ft time=102
Output k = 2:
dump_logs 1343
grep_logs 102