you give integer m n represent dimension matrixyou give head link list integersGenerate m x n matrix contain integer link list present spiral order clockwise start topleft matrix if remaining space fill 1return generate matrix Example 1Input m 3 n 5 head 3026817942550output 302685011152497explanation the diagram show value print matrixnote remain space matrix fill 1Example 2Input m 1 n 4 head 012output 0121explanation the diagram show value print leave right matrixthe space matrix set 1 Constraints1 m n 1051 m n 105the number node list range 1 m n0 Nodeval 1000