Broadridge interview question

dsa- easy level (arrays and strings).