Grapecity Interview Question

question based on string array and pattern