Slack office management tracks employee attendance through an automated badge system. Each time an employee enters or leaves the workspace, a log entry is created recording the event day, the employee ID, and the specific hour of entry or exit.
Your task is to calculate the total time (in minutes or hours as per the integers) spent by each employee in the office for each unique day.
Rules:
- The total time spent is calculated by subtracting the entry time from the exit time for each record.
- Output columns: day, emp_id, total_time.
- Results must be sorted by day in ascending order, and then by emp_id in ascending order.