Mastercard Interview Question

was pretty straightforward