NextSphere interview question

coding questions on strings and arrays