Longest service uptime run
Your task
A probe log has one line per health check: "<ts> <service> <status>", with status "ok" or "error". For each service, look at its own checks in log order and find its longest run of consecutive "ok" results (checks of other services in between do not interrupt a run). Given at least one line, return the service with the longest such run; break ties by the alphabetically smallest service name. A service whose checks are all errors has a longest run of 0 and still participates.
Examples
steadiest_service(lines: list[str]) -> strExample 1
Input
steadiest_service(["t1 api ok", "t2 db ok", "t3 api ok", "t4 api error", "t5 db ok", "t6 api ok", "t7 db ok"])Output
"db"