Expense Approval Router

Easy ⏱ 8 min 80% acceptance ★★★★★ 4.8
Write approver(amount, category) routing expense claims: anything ≤ 5,000 → 'auto'; ≤ 50,000 → 'manager'; above that → 'director' — EXCEPT the 'travel' category, which always needs at least 'manager' even under 5,000.

Examples

Example 1
Input
approver(3000, 'meals')
Output
'auto'
Explanation

Small non-travel claims auto-approve.

Example 2
Input
approver(3000, 'travel')
Output
'manager'
Explanation

Travel never auto-approves.

Constraints

  • Exact thresholds as stated.
  • Travel exception applies only to the auto tier.

Topics

Business Logicrouting rules

Companies

SAP ConcurExpensifyZoho

Hints

Hint 1

Compute the tier first, then apply the exception.

Hint 2

Or check category == 'travel' inside the first branch.

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