TCS Interview Question

DSA - array and string