Affirm interview question

They asked a classic leetcode-style question