PTC interview question

Puzzles , easy level array and string DSA