UKG interview question

Three-sum