Loading problem...
A platform engineering team maintains status logs that mark when each server session begins and ends.
Table: Servers
Task: Compute the aggregate runtime across all servers and return the number of complete uptime days.
Pairing rule (critical): For each server independently:
After summing all paired session runtimes from every server:
Output requirements:
Important note:
Supported submission environments:
Servers:
| server_id | status_time | session_status |
|-----------|----------------------|----------------|
| 1 | 2024-03-01 08:00:00 | start |
| 1 | 2024-03-01 12:10:00 | start |
| 1 | 2024-03-01 14:09:00 | stop |
| 1 | 2024-03-01 17:20:00 | stop |
| 2 | 2024-03-02 00:00:00 | start |
| 2 | 2024-03-02 08:00:00 | stop |
| 2 | 2024-03-04 09:30:00 | start |
| 2 | 2024-03-04 10:44:00 | stop |
| 3 | 2024-03-06 01:00:00 | start |
| 3 | 2024-03-06 07:32:00 | stop |[
{"total_uptime_days": 1}
]All paired session seconds across the three servers sum to more than one day but less than two, so the final answer is 1.
Servers:
| server_id | status_time | session_status |
|-----------|----------------------|----------------|
| 9 | 2024-05-01 00:00:00 | start |
| 9 | 2024-05-01 06:00:00 | stop |
| 9 | 2024-05-01 10:00:00 | start |
| 9 | 2024-05-01 18:00:00 | stop |
| 9 | 2024-05-02 03:00:00 | start |
| 9 | 2024-05-02 11:00:00 | stop |[
{"total_uptime_days": 0}
]Total runtime is 22 hours, which is below one full day.
Servers:
| server_id | status_time | session_status |
|-----------|----------------------|----------------|
| 30 | 2024-01-10 00:00:00 | start |
| 30 | 2024-01-10 12:00:00 | stop |
| 30 | 2024-01-11 00:00:00 | start |
| 30 | 2024-01-12 00:00:00 | stop |
| 40 | 2024-01-15 00:00:00 | start |
| 40 | 2024-01-16 20:00:00 | stop |[
{"total_uptime_days": 3}
]Combined runtime is 12h + 24h + 44h = 80h. Since 80 hours contains 3 complete 24-hour blocks, the output is 3.
Constraints