Citadel interview question

Difficult leetcode problems, but certainly doable.