U.S. Bank interview question

Basic Java knowledge, small codility task