Santander interview question

Most difficult challenge