#K88187. Calculate Total Hours Worked
Calculate Total Hours Worked
Calculate Total Hours Worked
You are given work records for employees in a week. Each record contains a day of the week and a time interval in 24-hour format (HH:MM
). Your task is to compute the total hours worked in the week, ignoring invalid records. A record is considered invalid if:
- The record format is incorrect.
- The day is not one of the following: Mon, Tue, Wed, Thu, Fri, Sat, Sun.
- The start time or end time is not in the correct
HH:MM
format or represents an invalid time. - The start time is greater than or equal to the end time.
Output the total hours worked, rounded to 2 decimal places.
inputFormat
The first line contains an integer n, representing the number of work records. Each of the next n lines contains a work record in the format: Day HH:MM-HH:MM.
outputFormat
Output a single line containing the total hours worked, rounded to 2 decimal places.## sample
5
Mon 09:00-17:00
Tue 09:00-17:00
Wed 09:00-17:00
Thu 09:00-17:00
Fri 09:00-17:00
40.00