Gridlogic interview question

Create a web app which shows the graphical representation.