Deutsche Bank Interview Question

Basic programming problem