Ad
Graphs
Data Structures

Given any matrix, NxN or MxN we should be able to extract the inner matrix.

For example:
MxN [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]] -> [[6, 7]]
NxN [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]] -> [[6, 7], [10, 11]]

innerMatrix = array => array
  .slice(1, array.length - 1)
  .map(row => row.slice(1, array[0].length - 1));