Apple interview question

A leetcode medium on Apple's tagged