3Edge Interview Question

write a code for different patterns