Write a function. Test real cases. Improve your solution.
Compare current permission names with target permission names. Return {"grant": [...], "revoke": [...]}: grant contains names present only in target, and revoke contains names present only in current. Both inputs are lists of strings; ignore duplicates. Compare names case-sensitively. Sort each result list in Python's normal ascending string order. Return empty lists when no changes are needed, and leave both inputs unchanged.
[["read", "write"], ["read", "audit"]]
{"grant": ["audit"], "revoke": ["write"]}[[], ["write", "read"]]
{"grant": ["read", "write"], "revoke": []}[["write", "read"], []]
{"grant": [], "revoke": ["read", "write"]}[["read", "read"], ["read", "audit", "audit"]]
{"grant": ["audit"], "revoke": []}[["Read"], ["read"]]
{"grant": ["read"], "revoke": ["Read"]}[["read", "write"], ["write", "read"]]
{"grant": [], "revoke": []}Python 3.14 runs in your browser. The first run downloads about 13 MB; your browser can cache it for later visits. Each run starts fresh. Use synchronous functions and core standard-library modules. Network requests, package installs, and interactive input() are unavailable. Return lists, string-key dictionaries, strings, finite numbers, bools, or None. Student code stops after about four seconds, after Python loads. Python engine credits. Test results support self-study and don’t certify proficiency.