RBC interview question

an easy leetcode /med question