Visa Inc. interview question

What's a computational complexity of your solution?