Affirm interview question

Usual Leetcode ‘hard’ level coding problem