Corpay interview question

Explain code that I wrote