Palo Alto Networks Interview Question

Logic question with matrix of 3D array