Input: mat[][] = { { 1, 2, 3, 4, 5, 6 } }, A = 2, B = 3
Output: { { 1, 2, 3 }, { 4, 5, 6 } }
Explanation:
Since the size of the matrix { { 1, 2, 3 }, { 4, 5, 6 } } is A * B(2 * 3).
Therefore, the required output is { { 1, 2, 3 }, { 4, 5, 6 } }.
Input: mat[][] = { {1, 2}, { 3, 4 }, { 5, 6 } }, A = 1, B = 6
Output: { { 1, 2, 3, 4, 5, 6 } }