Ginger Webs interview question

coding question with patterns and matrix