Flag SLA Breaches

Easy ⏱ 8 min 78% acceptance ★★★★★ 4.8
SLA hours by priority: urgent 4, high 8, medium 24, low 72. Write breached(tickets) where each ticket is (id, priority, hours_open) — return the list of ids whose open time exceeds their SLA, keeping input order. Unknown priorities default to 24.

Examples

Example 1
Input
breached([(1, 'urgent', 5), (2, 'low', 50), (3, 'high', 8)])
Output
[1]
Explanation

Only the urgent ticket blew its 4-hour SLA; 8 == 8 is not a breach.

Constraints

  • Strictly greater than the SLA breaches.
  • Default SLA 24 for unknown priorities.

Topics

Business LogicSLA rules

Companies

FreshworksZendeskServiceNow

Hints

Hint 1

A dict of priority → hours.

Hint 2

.get(priority, 24) covers unknowns.

Loading the Python runtime… Run executes your code and shows printed output; Submit checks your function against this problem's examples.