BBVA interview question

Coding Challenge on Hacker Ranker