PTC Interview Question

Puzzles , easy level array and string DSA