BlackRock interview question

Two algorithms takst, one easier, and one harder