LinkedIn interview question

string question and array question can look on gfg for further information