Qualification Round Finished
Given you’re running a company & want to identify the best employee for each month and worst employee for each month along with average working hours for each month.
Given the situation, you have collected the dataset for each employee’s time logs for when they clock-in, clock-out, start a break and stop a break.
As per company policy, in the event that an employee time log for clock-out is not found, the candidate’s attendance is regularised (to be considered) by whichever is earlier out of the following:
Office clock-out time 7:30 PM
Standard 6 hours of shift for an employee.
Write an algorithm to identify the working hours for the best employee for each month and the working hours for the worst employee for each month along with the average working hours for each month.
T = Timelogs
EmpId Timestamp, Status (clock-in/out and break-start/stop)
Case #1: hh:mm:ss, hh:mm:ss, hh:mm:ss [Highest, Lowest, Average (per month)]
Timelogs of 10 months
Emps upto 5 (small)
Emps upto 10(large)
Sample Input
36
Emp_1 2019-06-04 10:28:25 clock-in
Emp_3 2019-06-04 11:13:55 clock-in
Emp_2 2019-06-04 11:38:05 clock-in
Emp_3 2019-06-04 11:58:55 break-start
Emp_3 2019-06-04 12:28:55 break-stop
Emp_1 2019-06-04 12:49:25 break-start
Emp_2 2019-06-04 13:11:05 break-start
Emp_1 2019-06-04 13:19:25 break-stop
Emp_2 2019-06-04 13:41:05 break-stop
Emp_1 2019-06-04 18:51:30 clock-out
Emp_3 2019-06-04 19:22:02 clock-out
Emp_2 2019-06-04 19:53:40 clock-out
Emp_3 2019-06-05 10:29:47 clock-in
Emp_2 2019-06-05 11:02:34 clock-in
Emp_3 2019-06-05 11:19:47 break-start
Emp_1 2019-06-05 11:44:20 clock-in
Emp_3 2019-06-05 11:49:47 break-stop
Emp_2 2019-06-05 13:07:34 break-start
Emp_2 2019-06-05 13:37:34 break-stop
Emp_1 2019-06-05 14:14:20 break-start
Emp_1 2019-06-05 14:44:20 break-stop
Emp_3 2019-06-05 17:12:41 clock-out
Emp_2 2019-06-05 18:41:39 clock-out
Emp_1 2019-06-05 18:56:05 clock-out
Emp_1 2019-06-06 10:10:17 clock-in
Emp_2 2019-06-06 10:16:01 clock-in
Emp_1 2019-06-06 10:32:17 break-start
Emp_2 2019-06-06 10:51:01 break-start
Emp_1 2019-06-06 11:02:17 break-stop
Emp_2 2019-06-06 11:21:01 break-stop
Emp_3 2019-06-06 11:57:32 clock-in
Emp_3 2019-06-06 14:22:32 break-start
Emp_3 2019-06-06 14:52:32 break-stop
Emp_1 2019-06-06 19:18:43 clock-out
Emp_3 2019-06-06 19:21:22 clock-out
Emp_2 2019-06-06 20:00:03 clock-out
Sample Output
Case #1: 23:04:48 21:48:00 22:28:12