RBC Interview Question

Simple coding challenge.