Visa Inc. Interview Question

a matrix coding question on codesignal.