Visa Inc. Interview Question

What's a computational complexity of your solution?