Problem Statement
What is a protocol in Swift?
Explanation
In Swift a protocol defines a set of methods and properties that a type must implement, but it does not specify how they are implemented. It allows different types (structs, classes, enums) to adopt the protocol and provide their own implementation. This promotes polymorphism and flexible design.