Global Payments interview question

debug the code given by them