Fexle Services Interview Question

to generate a code for star patterns using java