Antithesis interview question

Not going to release the problem, but it's something you'd see on Leetcode or a Intro to Algorithms class.