Given a mapping of teams to their data access patterns, and a list of deleted data files, determine which teams are impacted.
Build a system that can:
- Parse team data relationships
- Identify affected teams when specific data files are deleted
- Generate an alert list of teams that need immediate notification
Input Format
The system will receive a JSON object containing:
teams: Dictionary mapping team names to their data access patternsdata_read: List of data paths the team reads fromdata_written: List of data paths the team writes to
deleted_data: List of data paths that were deleted
Output Format
Return a list of teams that need to be alerted, sorted alphabetically.
This problem asks you to identify which teams are affected when certain data paths are deleted. A practical solution is to normalize each team's read and write paths into sets, compare them against the deleted data set, and mark any team with at least one matching path for alerting. Finally, return the impacted team names in alphabetical order. The main challenge is efficient membership checking and clean data aggregation rather than advanced algorithmic complexity.