RBC Interview Question

2 questions were asked in coding assessment