Visa Inc. Interview Question

asked about time complexity and space complexity