American Express Interview Question

check if another 2d array contains the same pattern