Nagarro Interview Question

Question on array and strings