3Edge interview question

write a code for different patterns