Zoho interview question

coding mostly on array and strings