Affirm interview question

One Leetcode style median difficulty question