Citadel Interview Question

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