Vistaar Technologies interview question

Star pattern coding question. Arrays