Nagarro interview question

Question on array and strings