Roche interview question

2 Easy to Medium leetcode