Let us consider an n-dimension matching problem of two matrices. Here the index number of each dimension of a matrix starts at 1. For two n-dimension matrixes S and T, if there is a position (p1, p2, p3, p4, …,pn) which satisfies that each element at the position (t1, t2, t3, t4, …,tn) in T is the same as the element at the position (p1 + t1 - 1, p2 + t2 - 1, p3 + t3 - 1, p4 + t4 - 1, …,pn + tn - 1) in S, we call it’s a matching position. So the n-dimension problem is to compute the matching position for given S and T. You can assume that the traditional string matching problem is the 1-dimension version of this problem, and the normal matrix matching problem is the 2-dimension version.