Bloomberg interview question

usual hacker rank coding question s