Problem Statement
What does the `defer` statement do in Swift?
Explanation
In Swift `defer` declares a block of code that will run when execution leaves the current scope (whether via return, error, or normal path). It's useful for cleanup tasks and ensures deterministic execution.