Wipro interview question

Write code for a given pattern