Mastercard Interview Question

Algorithms and Data Structures, efficiency