Code RoomReport severity with aging
MediumPrep Room Coding #4924

Report severity with aging

CodingAlgorithms & data structuresMid–Senior~22 min

One trust and safety reviewer works a stream of abuse reports. Report i is filed in minute filed_minutes[i] carrying base_severity[i] points, and a report that has been sitting unread gains aging points for every full minute it has waited, because stale reports are dangerous too. The reviewer clears exactly one report per minute, at the start of the minute, always taking the filed and unread report with the highest points at that instant. A tie goes to the lower report index. When nothing has been filed yet the reviewer waits, and picks up work again in the minute the next report is filed. Reports are listed in no particular order and several may be filed in the same minute. Return the report indices in the order they are cleared.

Implement
report_review_order(filed_minutes: list[int], base_severity: list[int], aging: int) → list[int]
Examples
in[[0,0,1],[10,4,6],5]out[0,1,2]
in[[0,0,1],[10,4,6],0]out[0,2,1]
in[[4,4],[7,7],3]out[0,1]
What a strong answer looks like

State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.

0:00 of about 22 min
InputExpectedGot
[[0,0,1],[10,4,6],5][0,1,2]not run yetsample
[[0,0,1],[10,4,6],0][0,2,1]not run yetsample
[[4,4],[7,7],3][0,1]not run yetsample