Deutsche Bank interview question

Basic programming problem