Corpay Interview Question

Explain code that I wrote