Question
Implement an RBAC permission evaluator. A user holds a list of `roles`; `role_permissions` maps each role name to a list of permission strings it grants. Given the user's roles, the role-permission map, and a `required` permission, return True if ANY of the user's roles grants the required permission. Unknown roles (not present in the map) grant nothing. A user with no roles is granted nothing.
has_permission(roles: list[str], role_permissions: dict, required: str) → bool[["admin"],{"admin":["read","write","delete"],"editor":["read","write"],"viewer":["read"]},"delete"]outtrueState 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.
Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.