Citadel interview question

algorithm complexity