Affirm interview question

Leetcode style problems easy/medium difficulty