instagram

Print m * n matrix diagonally

This algorithm to print m*n matrix diagonally. Algorithm going to take Big O(m*n/2) time

Input :

Output :

Below algorithm will take O(m*n/2) time.

Algorithm:

Share