Citadel interview question

See blind 75 or preferably, Neetcode 150 which is more than enough.