Your question is Basic iOS Fundamentals. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Tell me about the basic iOS concepts you rely on when building a new feature. Implement a validator for a simplified UIViewController lifecycle, returning whether an event sequence follows valid transitions. Input is a list of event strings beginning with init; valid events are viewDidLoad, viewWillAppear, viewDidAppear, viewWillDisappear, viewDidDisappear, and deinit. Return True for a valid sequence and False otherwise. For example, ["init", "viewDidLoad", "viewWillAppear"] is valid, while ["init", "viewDidAppear"] is invalid.
def validate_ios_lifecycle(events):