← Questions

Dependency-safe deletion order

0
GoogleCodingLast asked Aug 2026

Entities have parent-child relationships, and the relationships limit what can be deleted when. Model the relationships as a graph and return an order that deletes everything without breaking a constraint, or detect that no such order exists.

Write and test your solution herePython in your browser, the question's tests level by level, saved for you.Sign in to start coding