Jul-01-2022, 01:46 PM
3. Given a 2 D Array of N X M Dimension, Write a function that accepts this array as well as two
numbers N and M. The method should return the top-left N X M sub matrix e.g:
[
[1, 2, 3],
[4, 5, 6],
[7, 8, 9],
]
top_left_sub_matrix (matrix, 2, 2) -> should return:
[
[1, 2]
[4, 5]
]
numbers N and M. The method should return the top-left N X M sub matrix e.g:
[
[1, 2, 3],
[4, 5, 6],
[7, 8, 9],
]
top_left_sub_matrix (matrix, 2, 2) -> should return:
[
[1, 2]
[4, 5]
]