Spiral Print Array

How to calculate time complexity for this program ?

@vaishnavtannu
At first starting from the first row, print the whole content and then follow the last column to print , then the last row and so on, thus it prints the elements in spiral fashion. The time complexity of this algorithm is O(MN), M is the number of rows and N is the number of columns.
dont forget to hit like and mark resolved if cleared :smiley: