Apple interview question

Technical round -> assessment and logic