American Express Interview Question

Just a coding challenge online